{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path\n",
    "import sys\n",
    " \n",
    "tiramisu_filesys = '/data/mm12191/'\n",
    "benchmark_dataset_file = tiramisu_filesys+'datasets/benchmarks_ds2.json'\n",
    "\n",
    "store_device_name = 'cuda:4'\n",
    "train_device_name = 'cuda:4'\n",
    "\n",
    "k=5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### You should execute all cells after 'Utils' cell below, in order to continue the execution of this notebook. Good luck!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load Data\n",
    "<a id='load_data'></a>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "loading batches from: /data/mm12191/datasets/benchmarks_ds2.json\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4c4bcbd911fb4d10b92dc10a0e351e0d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/30 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Batching ... 0\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "266f292d835c4837a1e4f39f76cea350",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/3 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of datapoints 8884 Number of batches 8884\n",
      "Data loaded\n",
      "Sizes: (8884, 0) batches\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "04981bfaa325435fa0850b3a764f564a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/30 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of batches 3\n",
      "Data loaded\n",
      "Sizes: (3, 0) batches\n"
     ]
    }
   ],
   "source": [
    "#loading data for the cost model\n",
    "bench_ds, bench_bl, bench_indices, _, _ = load_data('/data/mm12191/datasets/benchmarks_ds2.json', \n",
    "                                             split_ratio = 1,\n",
    "                                             max_batch_size = 1,\n",
    "                                             drop_sched_func = drop_schedule, \n",
    "                                             drop_prog_func = None,\n",
    "                                             default_eval = default_eval,\n",
    "                                             speedups_clip_func = speedup_clip)\n",
    "#loading data for the k-best LI model\n",
    "bench_ds_LI, bench_bl_LI, bench_indices_LI, _, _  = load_merge_data(None, benchmark_dataset_file, 1, filter_func_MC=filter_schedule_MC, filter_func_SC=filter_schedule_SC)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Define Models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [],
   "source": [
    "#speedup model\n",
    "input_size = 776\n",
    "\n",
    "model = None \n",
    "\n",
    "model = Model_Recursive_LSTM_v2(input_size,drops=[0.250, 0.250, 0.250, 0.250])\n",
    "model.to(train_device)\n",
    "\n",
    "criterion = mape_criterion\n",
    "\n",
    "optimizer = AdamW(model.parameters(),weight_decay=0.1e-1)    \n",
    "    \n",
    "# model = model.double()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Model_Recursive_LSTM_LI(\n",
       "  (comp_embedding_layers): ModuleList(\n",
       "    (0): Linear(in_features=1272, out_features=600, bias=True)\n",
       "    (1): Linear(in_features=600, out_features=900, bias=True)\n",
       "    (2): Linear(in_features=900, out_features=600, bias=True)\n",
       "    (3): Linear(in_features=600, out_features=400, bias=True)\n",
       "    (4): Linear(in_features=400, out_features=200, bias=True)\n",
       "  )\n",
       "  (comp_embedding_dropouts): ModuleList(\n",
       "    (0): Dropout(p=0.275, inplace=False)\n",
       "    (1): Dropout(p=0.4, inplace=False)\n",
       "    (2): Dropout(p=0.275, inplace=False)\n",
       "    (3): Dropout(p=0.175, inplace=False)\n",
       "    (4): Dropout(p=0.175, inplace=False)\n",
       "  )\n",
       "  (regression_layers): ModuleList(\n",
       "    (0): Linear(in_features=200, out_features=400, bias=True)\n",
       "    (1): Linear(in_features=400, out_features=200, bias=True)\n",
       "  )\n",
       "  (regression_dropouts): ModuleList(\n",
       "    (0): Dropout(p=0.275, inplace=False)\n",
       "    (1): Dropout(p=0.4, inplace=False)\n",
       "  )\n",
       "  (concat_layers): ModuleList(\n",
       "    (0): Linear(in_features=424, out_features=400, bias=True)\n",
       "    (1): Linear(in_features=400, out_features=200, bias=True)\n",
       "  )\n",
       "  (concat_dropouts): ModuleList(\n",
       "    (0): Dropout(p=0.275, inplace=False)\n",
       "    (1): Dropout(p=0.4, inplace=False)\n",
       "  )\n",
       "  (predict): Linear(in_features=200, out_features=530, bias=True)\n",
       "  (ELU): ELU(alpha=1.0)\n",
       "  (comps_lstm): LSTM(200, 200, batch_first=True)\n",
       "  (nodes_lstm): LSTM(200, 200, batch_first=True)\n",
       ")"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#LI model\n",
    "input_size = 1272  #1238 #739 + 1 (loop depth added) precedently\n",
    "\n",
    "LI_model = None \n",
    "\n",
    "#model = Model_Recursive_LSTM_v2(input_size,drops=[0.112, 0.112, 0.112, 0.112], output_size=106) /\n",
    "# model = Model_Recursive_LSTM_v2(input_size,comp_embed_layer_sizes=[600, 350, 200, 180], drops=[0.4, 0.175, 0.275, 0.175], output_size=106) #first\n",
    "LI_model = Model_Recursive_LSTM_LI(input_size,comp_embed_layer_sizes=[600, 900, 600, 400, 200], drops=[0.275, 0.4, 0.275, 0.175, 0.175], output_size=106 * 5)\n",
    "\n",
    "LI_model.to(train_device) \n",
    "\n",
    "# criterion = nn.CrossEntropyLoss()\n",
    "\n",
    "# optimizer = AdamW(model.parameters(),weight_decay=0.375e-2)  #0.375e-2\n",
    "# optimizer = optim.RMSprop(model.parameters(), weight_decay=0.3e-2)    # RMSprop, Adagrad\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load Models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "model.load_state_dict(torch.load('/data/lm4718/CostModelMulti/MAPE_base_13+4+2.6.pkl',map_location=train_device))\n",
    "\n",
    "#not the last one\n",
    "# model.load_state_dict(torch.load('/data/mm12191/model_lab/temps_save_simple_fixed_val_batch550000-716507_STUE_ScedP_DefEval.pkl',map_location=train_device))\n",
    "model.to(train_device)\n",
    "print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "# LI_model.load_state_dict(torch.load('/data/lm4718/SC_ALL_Adams_ELU_xavier_13M_KBEST_2.pkl',map_location=train_device))\n",
    "# LI_model.load_state_dict(torch.load('/data/lm4718/LI_ALL_BEST_K/Models/SC_ALL_Adams_ELU_xavier_13M_KBEST_df_2.pkl',map_location=train_device))\n",
    "LI_model.load_state_dict(torch.load('/data/lm4718/LI_k_full/Models/full_1000_0.001_106_13M115_dropout_fused_kBest_0.0006_2000_4.pkl',map_location=train_device))\n",
    "LI_model.to(train_device)\n",
    "\n",
    "print()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Results "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "37e3470bf1f1477194ee11e4150775e5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/8884 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1c20819039ce46999bd316c36727389b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/3 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "bench_df = get_results_df(bench_ds, bench_bl, bench_indices, model)\n",
    "LI_bench_df = get_results_df_LI(bench_ds_LI, bench_bl_LI, bench_indices_LI, LI_model)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Exemple of the LI results output "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0.])"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "LI_bench_df.iloc[0][\"target\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n",
       "       0., 0., 0.])"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "LI_bench_df.iloc[0][\"prediction\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(['', 'I(L0,L1)', 'I(L1,L2)', 'I(L0,L2)'],\n",
       " ['I(L0,L1)', '', 'I(L0,L2)', 'I(L1,L2)'])"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#extract the LI from the output vectors\n",
    "i = 12\n",
    "get_LI_ordered(LI_bench_df.iloc[i][\"prediction\"]), get_LI_ordered(LI_bench_df.iloc[i][\"target\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Simulate beam search"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>sched_str</th>\n",
       "      <th>depth</th>\n",
       "      <th>priority</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>I(L0,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>I(L0,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>I(L0,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>I(L0,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>I(L0,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>I(L0,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>I(L0,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>I(L0,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>57</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>I(L2,L3)</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>I(L1,L3)</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td></td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>I(L1,L2)</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        name sched_str depth priority\n",
       "0      function_heat2d_LARGE               1        0\n",
       "1      function_heat2d_LARGE  I(L0,L1)     1        1\n",
       "2     function_heat2d_MEDIUM               1        0\n",
       "3     function_heat2d_MEDIUM  I(L0,L1)     1        1\n",
       "4       function_heat2d_MINI               1        0\n",
       "5       function_heat2d_MINI  I(L0,L1)     1        1\n",
       "6      function_heat2d_SMALL               1        0\n",
       "7      function_heat2d_SMALL  I(L0,L1)     1        1\n",
       "8     function_heat2d_XLARGE               1        0\n",
       "9     function_heat2d_XLARGE  I(L0,L1)     1        1\n",
       "10   function_jacobi1d_LARGE               1        0\n",
       "11  function_jacobi1d_MEDIUM               1        0\n",
       "12    function_jacobi1d_MINI               1        0\n",
       "13   function_jacobi1d_SMALL               1        0\n",
       "14  function_jacobi1d_XLARGE               1        0\n",
       "15       function_blur_LARGE               1        0\n",
       "16       function_blur_LARGE  I(L0,L1)     1        1\n",
       "17       function_blur_LARGE  I(L1,L2)     1        2\n",
       "18       function_blur_LARGE  I(L0,L2)     1        3\n",
       "19      function_blur_MEDIUM               1        0\n",
       "20      function_blur_MEDIUM  I(L0,L1)     1        1\n",
       "21      function_blur_MEDIUM  I(L1,L2)     1        2\n",
       "22      function_blur_MEDIUM  I(L0,L2)     1        3\n",
       "23        function_blur_MINI               1        0\n",
       "24        function_blur_MINI  I(L0,L1)     1        1\n",
       "25        function_blur_MINI  I(L1,L2)     1        2\n",
       "26        function_blur_MINI  I(L0,L2)     1        3\n",
       "27       function_blur_SMALL               1        0\n",
       "28       function_blur_SMALL  I(L0,L1)     1        1\n",
       "29       function_blur_SMALL  I(L1,L2)     1        2\n",
       "30       function_blur_SMALL  I(L0,L2)     1        3\n",
       "31      function_blur_XLARGE               1        0\n",
       "32      function_blur_XLARGE  I(L0,L1)     1        1\n",
       "33      function_blur_XLARGE  I(L1,L2)     1        2\n",
       "34      function_blur_XLARGE  I(L0,L2)     1        3\n",
       "35   function_jacobi2d_LARGE               1        0\n",
       "36   function_jacobi2d_LARGE  I(L1,L2)     1        1\n",
       "37  function_jacobi2d_MEDIUM  I(L1,L2)     1        0\n",
       "38  function_jacobi2d_MEDIUM               1        1\n",
       "39    function_jacobi2d_MINI  I(L1,L2)     1        0\n",
       "40    function_jacobi2d_MINI               1        1\n",
       "41   function_jacobi2d_SMALL  I(L1,L2)     1        0\n",
       "42   function_jacobi2d_SMALL               1        1\n",
       "43    function_matmul_MEDIUM               1        0\n",
       "44    function_matmul_MEDIUM  I(L0,L1)     1        1\n",
       "45    function_matmul_MEDIUM  I(L1,L2)     1        2\n",
       "46    function_matmul_MEDIUM  I(L0,L2)     1        3\n",
       "47      function_matmul_MINI  I(L1,L2)     1        0\n",
       "48      function_matmul_MINI               1        1\n",
       "49      function_matmul_MINI  I(L0,L1)     1        2\n",
       "50      function_matmul_MINI  I(L0,L2)     1        3\n",
       "51     function_matmul_SMALL               1        0\n",
       "52     function_matmul_SMALL  I(L1,L2)     1        1\n",
       "53     function_matmul_SMALL  I(L0,L2)     1        2\n",
       "54   function_seidel2d_LARGE               1        0\n",
       "55  function_seidel2d_MEDIUM               1        0\n",
       "56    function_seidel2d_MINI               1        0\n",
       "57   function_seidel2d_SMALL               1        0\n",
       "58     function_heat3d_LARGE  I(L2,L3)     1        0\n",
       "59     function_heat3d_LARGE               1        1\n",
       "60     function_heat3d_LARGE  I(L1,L2)     1        2\n",
       "61    function_heat3d_MEDIUM               1        0\n",
       "62    function_heat3d_MEDIUM  I(L1,L2)     1        1\n",
       "63      function_heat3d_MINI               1        0\n",
       "64      function_heat3d_MINI  I(L1,L2)     1        1\n",
       "65      function_heat3d_MINI  I(L1,L3)     1        2\n",
       "66     function_heat3d_SMALL               1        0\n",
       "67     function_heat3d_SMALL  I(L1,L2)     1        1"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#get the predictions made by the LI model to use them in the Simulation of beam search.\n",
    "enforced_scheds_df = pd.DataFrame(columns=['name','sched_str', 'depth','priority'])\n",
    "enf = 0\n",
    "for ind in LI_bench_df.index:\n",
    "    name = LI_bench_df[\"name\"][ind]\n",
    "    LIs = get_LI_ordered(LI_bench_df[\"prediction\"][ind])\n",
    "    if LIs == []:\n",
    "        print(\"--\")\n",
    "    i = 0\n",
    "    for li in LIs:\n",
    "        enforced_scheds_df.loc[enf] = [name, li, 1, i]# 1 is the level\n",
    "        i += 1\n",
    "        enf += 1\n",
    "enforced_scheds_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>sched_str</th>\n",
       "      <th>depth</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [name, sched_str, depth]\n",
       "Index: []"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#use only the cost model\n",
    "# enforced_scheds_df = pd.DataFrame(columns=['name','sched_str', 'depth'])\n",
    "# enforced_scheds_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d0e6efaa1fb7440186da2b86dcd7370e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/30 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>nb_scheds</th>\n",
       "      <th>base_time</th>\n",
       "      <th>eval_mode</th>\n",
       "      <th>bs=1</th>\n",
       "      <th>bs=2</th>\n",
       "      <th>bs=3</th>\n",
       "      <th>bs=4</th>\n",
       "      <th>bs=5</th>\n",
       "      <th>bs=6</th>\n",
       "      <th>bs=7</th>\n",
       "      <th>bs=8</th>\n",
       "      <th>bs=9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td>41</td>\n",
       "      <td>7.01036</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.26</td>\n",
       "      <td>1.26</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td>41</td>\n",
       "      <td>7.01036</td>\n",
       "      <td>model</td>\n",
       "      <td>1.26</td>\n",
       "      <td>1.26</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td>41</td>\n",
       "      <td>7.01036</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.26</td>\n",
       "      <td>1.26</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td>35</td>\n",
       "      <td>0.835829</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.61</td>\n",
       "      <td>1.62</td>\n",
       "      <td>1.64</td>\n",
       "      <td>1.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td>35</td>\n",
       "      <td>0.835829</td>\n",
       "      <td>model</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.61</td>\n",
       "      <td>1.62</td>\n",
       "      <td>1.64</td>\n",
       "      <td>1.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td>35</td>\n",
       "      <td>0.835829</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.47</td>\n",
       "      <td>1.61</td>\n",
       "      <td>1.62</td>\n",
       "      <td>1.64</td>\n",
       "      <td>1.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td>227</td>\n",
       "      <td>232.917999</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.49</td>\n",
       "      <td>1.56</td>\n",
       "      <td>1.56</td>\n",
       "      <td>1.56</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td>227</td>\n",
       "      <td>232.917999</td>\n",
       "      <td>model</td>\n",
       "      <td>1.49</td>\n",
       "      <td>1.56</td>\n",
       "      <td>1.56</td>\n",
       "      <td>1.56</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td>227</td>\n",
       "      <td>232.917999</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.49</td>\n",
       "      <td>1.56</td>\n",
       "      <td>1.56</td>\n",
       "      <td>1.56</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td>359</td>\n",
       "      <td>19681.5</td>\n",
       "      <td>execution</td>\n",
       "      <td>12.54</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td>359</td>\n",
       "      <td>19681.5</td>\n",
       "      <td>model</td>\n",
       "      <td>12.54</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td>359</td>\n",
       "      <td>19681.5</td>\n",
       "      <td>level1</td>\n",
       "      <td>12.54</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "      <td>14.89</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>762</td>\n",
       "      <td>0.946007</td>\n",
       "      <td>execution</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>762</td>\n",
       "      <td>0.946007</td>\n",
       "      <td>model</td>\n",
       "      <td>7.18</td>\n",
       "      <td>7.18</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>762</td>\n",
       "      <td>0.946007</td>\n",
       "      <td>level1</td>\n",
       "      <td>7.18</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>99</td>\n",
       "      <td>0.026936</td>\n",
       "      <td>execution</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>99</td>\n",
       "      <td>0.026936</td>\n",
       "      <td>model</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>99</td>\n",
       "      <td>0.026936</td>\n",
       "      <td>level1</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "      <td>4.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>3432</td>\n",
       "      <td>33.081902</td>\n",
       "      <td>execution</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>3432</td>\n",
       "      <td>33.081902</td>\n",
       "      <td>model</td>\n",
       "      <td>20.84</td>\n",
       "      <td>24.01</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>3432</td>\n",
       "      <td>33.081902</td>\n",
       "      <td>level1</td>\n",
       "      <td>20.84</td>\n",
       "      <td>24.01</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "      <td>86.62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>100</td>\n",
       "      <td>7.21077</td>\n",
       "      <td>execution</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.55</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>100</td>\n",
       "      <td>7.21077</td>\n",
       "      <td>model</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.55</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>100</td>\n",
       "      <td>7.21077</td>\n",
       "      <td>level1</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.12</td>\n",
       "      <td>3.55</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "      <td>3.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>70</td>\n",
       "      <td>1.24685</td>\n",
       "      <td>execution</td>\n",
       "      <td>2.15</td>\n",
       "      <td>2.15</td>\n",
       "      <td>3.09</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>70</td>\n",
       "      <td>1.24685</td>\n",
       "      <td>model</td>\n",
       "      <td>2.15</td>\n",
       "      <td>2.15</td>\n",
       "      <td>3.09</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>70</td>\n",
       "      <td>1.24685</td>\n",
       "      <td>level1</td>\n",
       "      <td>2.15</td>\n",
       "      <td>2.15</td>\n",
       "      <td>3.09</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "      <td>3.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>470</td>\n",
       "      <td>268.977997</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.89</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>2.47</td>\n",
       "      <td>3.51</td>\n",
       "      <td>3.64</td>\n",
       "      <td>4.40</td>\n",
       "      <td>4.40</td>\n",
       "      <td>4.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>470</td>\n",
       "      <td>268.977997</td>\n",
       "      <td>model</td>\n",
       "      <td>1.89</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>2.47</td>\n",
       "      <td>3.51</td>\n",
       "      <td>3.64</td>\n",
       "      <td>4.40</td>\n",
       "      <td>4.40</td>\n",
       "      <td>4.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>470</td>\n",
       "      <td>268.977997</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.89</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>2.47</td>\n",
       "      <td>3.51</td>\n",
       "      <td>3.64</td>\n",
       "      <td>4.40</td>\n",
       "      <td>4.40</td>\n",
       "      <td>4.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>734</td>\n",
       "      <td>17424.0</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.17</td>\n",
       "      <td>13.82</td>\n",
       "      <td>13.82</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>734</td>\n",
       "      <td>17424.0</td>\n",
       "      <td>model</td>\n",
       "      <td>1.17</td>\n",
       "      <td>13.82</td>\n",
       "      <td>13.82</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>734</td>\n",
       "      <td>17424.0</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.17</td>\n",
       "      <td>13.82</td>\n",
       "      <td>13.82</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "      <td>14.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>23.0481</td>\n",
       "      <td>execution</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>23.0481</td>\n",
       "      <td>model</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>23.0481</td>\n",
       "      <td>level1</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "      <td>2.17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td>16</td>\n",
       "      <td>0.040832</td>\n",
       "      <td>execution</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td>16</td>\n",
       "      <td>0.040832</td>\n",
       "      <td>model</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td>16</td>\n",
       "      <td>0.040832</td>\n",
       "      <td>level1</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "      <td>2.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td>10</td>\n",
       "      <td>0.00403</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td>10</td>\n",
       "      <td>0.00403</td>\n",
       "      <td>model</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td>10</td>\n",
       "      <td>0.00403</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "      <td>1.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td>46</td>\n",
       "      <td>0.407311</td>\n",
       "      <td>execution</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td>46</td>\n",
       "      <td>0.407311</td>\n",
       "      <td>model</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td>46</td>\n",
       "      <td>0.407311</td>\n",
       "      <td>level1</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "      <td>2.59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>5.72876</td>\n",
       "      <td>execution</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>5.72876</td>\n",
       "      <td>model</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>5.72876</td>\n",
       "      <td>level1</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>220</td>\n",
       "      <td>21.564301</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.08</td>\n",
       "      <td>1.35</td>\n",
       "      <td>1.35</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>220</td>\n",
       "      <td>21.564301</td>\n",
       "      <td>model</td>\n",
       "      <td>1.23</td>\n",
       "      <td>1.35</td>\n",
       "      <td>1.35</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>220</td>\n",
       "      <td>21.564301</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.23</td>\n",
       "      <td>1.35</td>\n",
       "      <td>1.35</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.43</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "      <td>1.73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>168</td>\n",
       "      <td>1.71655</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.40</td>\n",
       "      <td>1.76</td>\n",
       "      <td>1.82</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>168</td>\n",
       "      <td>1.71655</td>\n",
       "      <td>model</td>\n",
       "      <td>1.11</td>\n",
       "      <td>1.76</td>\n",
       "      <td>1.82</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>168</td>\n",
       "      <td>1.71655</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.39</td>\n",
       "      <td>1.76</td>\n",
       "      <td>1.82</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.91</td>\n",
       "      <td>1.93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>300</td>\n",
       "      <td>197.315994</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.36</td>\n",
       "      <td>3.22</td>\n",
       "      <td>3.39</td>\n",
       "      <td>3.70</td>\n",
       "      <td>3.71</td>\n",
       "      <td>3.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>300</td>\n",
       "      <td>197.315994</td>\n",
       "      <td>model</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.36</td>\n",
       "      <td>3.22</td>\n",
       "      <td>3.39</td>\n",
       "      <td>3.70</td>\n",
       "      <td>3.71</td>\n",
       "      <td>3.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>300</td>\n",
       "      <td>197.315994</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.25</td>\n",
       "      <td>1.36</td>\n",
       "      <td>3.22</td>\n",
       "      <td>3.39</td>\n",
       "      <td>3.70</td>\n",
       "      <td>3.71</td>\n",
       "      <td>3.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>57</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>1468</td>\n",
       "      <td>20338.800781</td>\n",
       "      <td>execution</td>\n",
       "      <td>12.73</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>1468</td>\n",
       "      <td>20338.800781</td>\n",
       "      <td>model</td>\n",
       "      <td>16.39</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>1468</td>\n",
       "      <td>20338.800781</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.36</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "      <td>18.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>20.381001</td>\n",
       "      <td>execution</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>20.381001</td>\n",
       "      <td>model</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>20.381001</td>\n",
       "      <td>level1</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "      <td>5.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>36</td>\n",
       "      <td>0.010014</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>36</td>\n",
       "      <td>0.010014</td>\n",
       "      <td>model</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>36</td>\n",
       "      <td>0.010014</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>21</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>21</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>model</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>21</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "      <td>1.34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>78</td>\n",
       "      <td>0.096483</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>78</td>\n",
       "      <td>0.096483</td>\n",
       "      <td>model</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>78</td>\n",
       "      <td>0.096483</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "      <td>1.79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>72</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>3.12811</td>\n",
       "      <td>execution</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>73</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>3.12811</td>\n",
       "      <td>model</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>3.12811</td>\n",
       "      <td>level1</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "      <td>8.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>17.4445</td>\n",
       "      <td>execution</td>\n",
       "      <td>3.87</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>17.4445</td>\n",
       "      <td>model</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>17.4445</td>\n",
       "      <td>level1</td>\n",
       "      <td>3.87</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "      <td>4.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>52</td>\n",
       "      <td>0.014422</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>52</td>\n",
       "      <td>0.014422</td>\n",
       "      <td>model</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>52</td>\n",
       "      <td>0.014422</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "      <td>1.21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>48</td>\n",
       "      <td>0.00276</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.05</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>48</td>\n",
       "      <td>0.00276</td>\n",
       "      <td>model</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.05</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>48</td>\n",
       "      <td>0.00276</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.05</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "      <td>2.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>124</td>\n",
       "      <td>0.114715</td>\n",
       "      <td>execution</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>124</td>\n",
       "      <td>0.114715</td>\n",
       "      <td>model</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>124</td>\n",
       "      <td>0.114715</td>\n",
       "      <td>level1</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "      <td>1.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>3.2137</td>\n",
       "      <td>execution</td>\n",
       "      <td>3.07</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>3.2137</td>\n",
       "      <td>model</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>3.2137</td>\n",
       "      <td>level1</td>\n",
       "      <td>3.07</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "      <td>6.80</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        name nb_scheds     base_time  eval_mode   bs=1   bs=2  \\\n",
       "0    function_seidel2d_SMALL        41       7.01036  execution   1.26   1.26   \n",
       "1    function_seidel2d_SMALL        41       7.01036      model   1.26   1.26   \n",
       "2    function_seidel2d_SMALL        41       7.01036     level1   1.26   1.26   \n",
       "3     function_seidel2d_MINI        35      0.835829  execution   1.47   1.47   \n",
       "4     function_seidel2d_MINI        35      0.835829      model   1.47   1.47   \n",
       "5     function_seidel2d_MINI        35      0.835829     level1   1.47   1.47   \n",
       "6   function_seidel2d_MEDIUM       227    232.917999  execution   1.49   1.56   \n",
       "7   function_seidel2d_MEDIUM       227    232.917999      model   1.49   1.56   \n",
       "8   function_seidel2d_MEDIUM       227    232.917999     level1   1.49   1.56   \n",
       "9    function_seidel2d_LARGE       359       19681.5  execution  12.54  14.89   \n",
       "10   function_seidel2d_LARGE       359       19681.5      model  12.54  14.89   \n",
       "11   function_seidel2d_LARGE       359       19681.5     level1  12.54  14.89   \n",
       "12     function_matmul_SMALL       762      0.946007  execution  10.28  10.28   \n",
       "13     function_matmul_SMALL       762      0.946007      model   7.18   7.18   \n",
       "14     function_matmul_SMALL       762      0.946007     level1   7.18  10.28   \n",
       "15      function_matmul_MINI        99      0.026936  execution   4.91   4.91   \n",
       "16      function_matmul_MINI        99      0.026936      model   4.91   4.91   \n",
       "17      function_matmul_MINI        99      0.026936     level1   4.91   4.91   \n",
       "18    function_matmul_MEDIUM      3432     33.081902  execution  86.62  86.62   \n",
       "19    function_matmul_MEDIUM      3432     33.081902      model  20.84  24.01   \n",
       "20    function_matmul_MEDIUM      3432     33.081902     level1  20.84  24.01   \n",
       "21   function_jacobi2d_SMALL       100       7.21077  execution   3.12   3.12   \n",
       "22   function_jacobi2d_SMALL       100       7.21077      model   3.12   3.12   \n",
       "23   function_jacobi2d_SMALL       100       7.21077     level1   3.12   3.12   \n",
       "24    function_jacobi2d_MINI        70       1.24685  execution   2.15   2.15   \n",
       "25    function_jacobi2d_MINI        70       1.24685      model   2.15   2.15   \n",
       "26    function_jacobi2d_MINI        70       1.24685     level1   2.15   2.15   \n",
       "27  function_jacobi2d_MEDIUM       470    268.977997  execution   1.89   1.91   \n",
       "28  function_jacobi2d_MEDIUM       470    268.977997      model   1.89   1.91   \n",
       "29  function_jacobi2d_MEDIUM       470    268.977997     level1   1.89   1.91   \n",
       "30   function_jacobi2d_LARGE       734       17424.0  execution   1.17  13.82   \n",
       "31   function_jacobi2d_LARGE       734       17424.0      model   1.17  13.82   \n",
       "32   function_jacobi2d_LARGE       734       17424.0     level1   1.17  13.82   \n",
       "33  function_jacobi1d_XLARGE        64       23.0481  execution   2.17   2.17   \n",
       "34  function_jacobi1d_XLARGE        64       23.0481      model   2.17   2.17   \n",
       "35  function_jacobi1d_XLARGE        64       23.0481     level1   2.17   2.17   \n",
       "36   function_jacobi1d_SMALL        16      0.040832  execution   2.04   2.04   \n",
       "37   function_jacobi1d_SMALL        16      0.040832      model   2.04   2.04   \n",
       "38   function_jacobi1d_SMALL        16      0.040832     level1   2.04   2.04   \n",
       "39    function_jacobi1d_MINI        10       0.00403  execution   1.28   1.28   \n",
       "40    function_jacobi1d_MINI        10       0.00403      model   1.28   1.28   \n",
       "41    function_jacobi1d_MINI        10       0.00403     level1   1.28   1.28   \n",
       "42  function_jacobi1d_MEDIUM        46      0.407311  execution   2.59   2.59   \n",
       "43  function_jacobi1d_MEDIUM        46      0.407311      model   2.59   2.59   \n",
       "44  function_jacobi1d_MEDIUM        46      0.407311     level1   2.59   2.59   \n",
       "45   function_jacobi1d_LARGE        64       5.72876  execution   2.10   2.10   \n",
       "46   function_jacobi1d_LARGE        64       5.72876      model   2.10   2.10   \n",
       "47   function_jacobi1d_LARGE        64       5.72876     level1   2.10   2.10   \n",
       "48     function_heat3d_SMALL       220     21.564301  execution   1.08   1.35   \n",
       "49     function_heat3d_SMALL       220     21.564301      model   1.23   1.35   \n",
       "50     function_heat3d_SMALL       220     21.564301     level1   1.23   1.35   \n",
       "51      function_heat3d_MINI       168       1.71655  execution   1.40   1.76   \n",
       "52      function_heat3d_MINI       168       1.71655      model   1.11   1.76   \n",
       "53      function_heat3d_MINI       168       1.71655     level1   1.39   1.76   \n",
       "54    function_heat3d_MEDIUM       300    197.315994  execution   1.25   1.25   \n",
       "55    function_heat3d_MEDIUM       300    197.315994      model   1.25   1.25   \n",
       "56    function_heat3d_MEDIUM       300    197.315994     level1   1.25   1.25   \n",
       "57     function_heat3d_LARGE      1468  20338.800781  execution  12.73  18.60   \n",
       "58     function_heat3d_LARGE      1468  20338.800781      model  16.39  18.60   \n",
       "59     function_heat3d_LARGE      1468  20338.800781     level1   1.36  18.60   \n",
       "60    function_heat2d_XLARGE        78     20.381001  execution   5.52   5.52   \n",
       "61    function_heat2d_XLARGE        78     20.381001      model   5.52   5.52   \n",
       "62    function_heat2d_XLARGE        78     20.381001     level1   5.52   5.52   \n",
       "63     function_heat2d_SMALL        36      0.010014  execution   1.00   1.00   \n",
       "64     function_heat2d_SMALL        36      0.010014      model   1.00   1.00   \n",
       "65     function_heat2d_SMALL        36      0.010014     level1   1.00   1.00   \n",
       "66      function_heat2d_MINI        21      0.001186  execution   1.00   1.34   \n",
       "67      function_heat2d_MINI        21      0.001186      model   1.00   1.34   \n",
       "68      function_heat2d_MINI        21      0.001186     level1   1.00   1.34   \n",
       "69    function_heat2d_MEDIUM        78      0.096483  execution   1.00   1.79   \n",
       "70    function_heat2d_MEDIUM        78      0.096483      model   1.00   1.79   \n",
       "71    function_heat2d_MEDIUM        78      0.096483     level1   1.00   1.79   \n",
       "72     function_heat2d_LARGE        78       3.12811  execution   8.09   8.09   \n",
       "73     function_heat2d_LARGE        78       3.12811      model   8.09   8.09   \n",
       "74     function_heat2d_LARGE        78       3.12811     level1   8.09   8.09   \n",
       "75      function_blur_XLARGE       160       17.4445  execution   3.87   4.56   \n",
       "76      function_blur_XLARGE       160       17.4445      model   4.56   4.56   \n",
       "77      function_blur_XLARGE       160       17.4445     level1   3.87   4.56   \n",
       "78       function_blur_SMALL        52      0.014422  execution   1.21   1.21   \n",
       "79       function_blur_SMALL        52      0.014422      model   1.04   1.21   \n",
       "80       function_blur_SMALL        52      0.014422     level1   1.04   1.21   \n",
       "81        function_blur_MINI        48       0.00276  execution   1.04   1.05   \n",
       "82        function_blur_MINI        48       0.00276      model   1.05   1.05   \n",
       "83        function_blur_MINI        48       0.00276     level1   1.05   1.05   \n",
       "84      function_blur_MEDIUM       124      0.114715  execution   1.92   1.92   \n",
       "85      function_blur_MEDIUM       124      0.114715      model   1.92   1.92   \n",
       "86      function_blur_MEDIUM       124      0.114715     level1   1.92   1.92   \n",
       "87       function_blur_LARGE       160        3.2137  execution   3.07   6.80   \n",
       "88       function_blur_LARGE       160        3.2137      model   6.80   6.80   \n",
       "89       function_blur_LARGE       160        3.2137     level1   3.07   6.80   \n",
       "\n",
       "     bs=3   bs=4   bs=5   bs=6   bs=7   bs=8   bs=9  \n",
       "0    1.43   1.43   1.43   1.43   1.43   1.43   1.43  \n",
       "1    1.43   1.43   1.43   1.43   1.43   1.43   1.43  \n",
       "2    1.43   1.43   1.43   1.43   1.43   1.43   1.43  \n",
       "3    1.47   1.47   1.47   1.61   1.62   1.64   1.64  \n",
       "4    1.47   1.47   1.47   1.61   1.62   1.64   1.64  \n",
       "5    1.47   1.47   1.47   1.61   1.62   1.64   1.64  \n",
       "6    1.56   1.56   3.40   3.40   3.40   3.40   3.40  \n",
       "7    1.56   1.56   3.40   3.40   3.40   3.40   3.40  \n",
       "8    1.56   1.56   3.40   3.40   3.40   3.40   3.40  \n",
       "9   14.89  14.89  14.89  14.89  14.89  14.89  14.89  \n",
       "10  14.89  14.89  14.89  14.89  14.89  14.89  14.89  \n",
       "11  14.89  14.89  14.89  14.89  14.89  14.89  14.89  \n",
       "12  10.28  10.28  10.28  10.28  10.28  10.28  10.28  \n",
       "13  10.28  10.28  10.28  10.28  10.28  10.28  10.28  \n",
       "14  10.28  10.28  10.28  10.28  10.28  10.28  10.28  \n",
       "15   4.91   4.91   4.91   4.91   4.91   4.91   4.91  \n",
       "16   4.91   4.91   4.91   4.91   4.91   4.91   4.91  \n",
       "17   4.91   4.91   4.91   4.91   4.91   4.91   4.91  \n",
       "18  86.62  86.62  86.62  86.62  86.62  86.62  86.62  \n",
       "19  86.62  86.62  86.62  86.62  86.62  86.62  86.62  \n",
       "20  86.62  86.62  86.62  86.62  86.62  86.62  86.62  \n",
       "21   3.12   3.55   3.56   3.56   3.56   3.56   3.56  \n",
       "22   3.12   3.55   3.56   3.56   3.56   3.56   3.56  \n",
       "23   3.12   3.55   3.56   3.56   3.56   3.56   3.56  \n",
       "24   3.09   3.33   3.33   3.33   3.33   3.33   3.33  \n",
       "25   3.09   3.33   3.33   3.33   3.33   3.33   3.33  \n",
       "26   3.09   3.33   3.33   3.33   3.33   3.33   3.33  \n",
       "27   1.91   2.47   3.51   3.64   4.40   4.40   4.40  \n",
       "28   1.91   2.47   3.51   3.64   4.40   4.40   4.40  \n",
       "29   1.91   2.47   3.51   3.64   4.40   4.40   4.40  \n",
       "30  13.82  14.18  14.18  14.18  14.18  14.18  14.18  \n",
       "31  13.82  14.18  14.18  14.18  14.18  14.18  14.18  \n",
       "32  13.82  14.18  14.18  14.18  14.18  14.18  14.18  \n",
       "33   2.17   2.17   2.17   2.17   2.17   2.17   2.17  \n",
       "34   2.17   2.17   2.17   2.17   2.17   2.17   2.17  \n",
       "35   2.17   2.17   2.17   2.17   2.17   2.17   2.17  \n",
       "36   2.04   2.04   2.04   2.04   2.04   2.04   2.04  \n",
       "37   2.04   2.04   2.04   2.04   2.04   2.04   2.04  \n",
       "38   2.04   2.04   2.04   2.04   2.04   2.04   2.04  \n",
       "39   1.28   1.28   1.28   1.28   1.28   1.28   1.28  \n",
       "40   1.28   1.28   1.28   1.28   1.28   1.28   1.28  \n",
       "41   1.28   1.28   1.28   1.28   1.28   1.28   1.28  \n",
       "42   2.59   2.59   2.59   2.59   2.59   2.59   2.59  \n",
       "43   2.59   2.59   2.59   2.59   2.59   2.59   2.59  \n",
       "44   2.59   2.59   2.59   2.59   2.59   2.59   2.59  \n",
       "45   2.10   2.10   2.10   2.10   2.10   2.10   2.10  \n",
       "46   2.10   2.10   2.10   2.10   2.10   2.10   2.10  \n",
       "47   2.10   2.10   2.10   2.10   2.10   2.10   2.10  \n",
       "48   1.35   1.43   1.43   1.73   1.73   1.73   1.73  \n",
       "49   1.35   1.43   1.43   1.73   1.73   1.73   1.73  \n",
       "50   1.35   1.43   1.43   1.73   1.73   1.73   1.73  \n",
       "51   1.82   1.91   1.91   1.91   1.91   1.91   1.93  \n",
       "52   1.82   1.91   1.91   1.91   1.91   1.91   1.93  \n",
       "53   1.82   1.91   1.91   1.91   1.91   1.91   1.93  \n",
       "54   1.25   1.36   3.22   3.39   3.70   3.71   3.71  \n",
       "55   1.25   1.36   3.22   3.39   3.70   3.71   3.71  \n",
       "56   1.25   1.36   3.22   3.39   3.70   3.71   3.71  \n",
       "57  18.60  18.60  18.60  18.60  18.60  18.60  18.60  \n",
       "58  18.60  18.60  18.60  18.60  18.60  18.60  18.60  \n",
       "59  18.60  18.60  18.60  18.60  18.60  18.60  18.60  \n",
       "60   5.52   5.52   5.52   5.52   5.52   5.52   5.52  \n",
       "61   5.52   5.52   5.52   5.52   5.52   5.52   5.52  \n",
       "62   5.52   5.52   5.52   5.52   5.52   5.52   5.52  \n",
       "63   1.00   1.00   1.00   1.00   1.00   1.00   1.00  \n",
       "64   1.00   1.00   1.00   1.00   1.00   1.00   1.00  \n",
       "65   1.00   1.00   1.00   1.00   1.00   1.00   1.00  \n",
       "66   1.34   1.34   1.34   1.34   1.34   1.34   1.34  \n",
       "67   1.34   1.34   1.34   1.34   1.34   1.34   1.34  \n",
       "68   1.34   1.34   1.34   1.34   1.34   1.34   1.34  \n",
       "69   1.79   1.79   1.79   1.79   1.79   1.79   1.79  \n",
       "70   1.79   1.79   1.79   1.79   1.79   1.79   1.79  \n",
       "71   1.79   1.79   1.79   1.79   1.79   1.79   1.79  \n",
       "72   8.09   8.09   8.09   8.09   8.09   8.09   8.09  \n",
       "73   8.09   8.09   8.09   8.09   8.09   8.09   8.09  \n",
       "74   8.09   8.09   8.09   8.09   8.09   8.09   8.09  \n",
       "75   4.56   4.56   4.56   4.56   4.56   4.56   4.56  \n",
       "76   4.56   4.56   4.56   4.56   4.56   4.56   4.56  \n",
       "77   4.56   4.56   4.56   4.56   4.56   4.56   4.56  \n",
       "78   1.21   1.21   1.21   1.21   1.21   1.21   1.21  \n",
       "79   1.21   1.21   1.21   1.21   1.21   1.21   1.21  \n",
       "80   1.21   1.21   1.21   1.21   1.21   1.21   1.21  \n",
       "81   1.05   2.39   2.39   2.39   2.39   2.39   2.39  \n",
       "82   2.39   2.39   2.39   2.39   2.39   2.39   2.39  \n",
       "83   2.39   2.39   2.39   2.39   2.39   2.39   2.39  \n",
       "84   1.92   1.92   1.92   1.92   1.92   1.92   1.92  \n",
       "85   1.92   1.92   1.92   1.92   1.92   1.92   1.92  \n",
       "86   1.92   1.92   1.92   1.92   1.92   1.92   1.92  \n",
       "87   6.80   6.80   6.80   6.80   6.80   6.80   6.80  \n",
       "88   6.80   6.80   6.80   6.80   6.80   6.80   6.80  \n",
       "89   6.80   6.80   6.80   6.80   6.80   6.80   6.80  "
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#return the results of beam search, with the speedups of the final schedules\n",
    "pd.set_option('display.max_rows',100)\n",
    "# df = simulate_BeamSearch_on_Dataset(bench_ds,bench_df, enforced_scheds_df, true_beam_search=False, get='schedules')\n",
    "df = simulate_BeamSearch_on_Dataset(bench_ds,bench_df, enforced_scheds_df, true_beam_search=False, get='speedups')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4cbce1437ff640cbb3846261e3792bc8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/30 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>nb_scheds</th>\n",
       "      <th>base_time</th>\n",
       "      <th>eval_mode</th>\n",
       "      <th>bs=1</th>\n",
       "      <th>bs=2</th>\n",
       "      <th>bs=3</th>\n",
       "      <th>bs=4</th>\n",
       "      <th>bs=5</th>\n",
       "      <th>bs=6</th>\n",
       "      <th>bs=7</th>\n",
       "      <th>bs=8</th>\n",
       "      <th>bs=9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td>41</td>\n",
       "      <td>7.01036</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L1,L2,3,2)</td>\n",
       "      <td>S(L1,L2,3,2)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td>41</td>\n",
       "      <td>7.01036</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L1,L2,3,2)</td>\n",
       "      <td>S(L1,L2,3,2)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td>41</td>\n",
       "      <td>7.01036</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L1,L2,3,2)</td>\n",
       "      <td>S(L1,L2,3,2)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "      <td>S(L1,L2,2,1)T2(L1,L2,32,32)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td>35</td>\n",
       "      <td>0.835829</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L0,L1,2,1)U(L2,8)</td>\n",
       "      <td>S(L0,L1,3,2)U(L2,16)</td>\n",
       "      <td>S(L0,L1,3,1)U(L2,8)</td>\n",
       "      <td>S(L0,L1,3,1)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td>35</td>\n",
       "      <td>0.835829</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L0,L1,2,1)U(L2,8)</td>\n",
       "      <td>S(L0,L1,3,2)U(L2,16)</td>\n",
       "      <td>S(L0,L1,3,1)U(L2,8)</td>\n",
       "      <td>S(L0,L1,3,1)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td>35</td>\n",
       "      <td>0.835829</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L0,L1,2,1)U(L2,8)</td>\n",
       "      <td>S(L0,L1,3,2)U(L2,16)</td>\n",
       "      <td>S(L0,L1,3,1)U(L2,8)</td>\n",
       "      <td>S(L0,L1,3,1)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td>227</td>\n",
       "      <td>232.917999</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td>227</td>\n",
       "      <td>232.917999</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td>227</td>\n",
       "      <td>232.917999</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L1,L2,3,1)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L1,L2,3,2)T2(L1,L2,32,64)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td>359</td>\n",
       "      <td>19681.5</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L0,L1,3,2)P(L1)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td>359</td>\n",
       "      <td>19681.5</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L0,L1,3,2)P(L1)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td>359</td>\n",
       "      <td>19681.5</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L0,L1,3,2)P(L1)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L2,4)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>762</td>\n",
       "      <td>0.946007</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>762</td>\n",
       "      <td>0.946007</td>\n",
       "      <td>model</td>\n",
       "      <td>P(L0)T3(L0,L1,L2,32,64,32)U(L5,4)</td>\n",
       "      <td>P(L0)T3(L0,L1,L2,32,64,32)U(L5,4)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>762</td>\n",
       "      <td>0.946007</td>\n",
       "      <td>level1</td>\n",
       "      <td>P(L0)T3(L0,L1,L2,32,64,32)U(L5,4)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>99</td>\n",
       "      <td>0.026936</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>99</td>\n",
       "      <td>0.026936</td>\n",
       "      <td>model</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>99</td>\n",
       "      <td>0.026936</td>\n",
       "      <td>level1</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>3432</td>\n",
       "      <td>33.081902</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>3432</td>\n",
       "      <td>33.081902</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L1,L2,1,2)P(L0)T2(L1,L2,128,32)</td>\n",
       "      <td>S(L1,L2,1,1)P(L0)T2(L1,L2,128,32)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>3432</td>\n",
       "      <td>33.081902</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L1,L2,1,2)P(L0)T2(L1,L2,128,32)</td>\n",
       "      <td>S(L1,L2,1,1)P(L0)T2(L1,L2,128,32)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "      <td>I(L1,L2)P(L0)T2(L1,L2,64,128)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>100</td>\n",
       "      <td>7.21077</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>100</td>\n",
       "      <td>7.21077</td>\n",
       "      <td>model</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>100</td>\n",
       "      <td>7.21077</td>\n",
       "      <td>level1</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>70</td>\n",
       "      <td>1.24685</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,3)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,3)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>70</td>\n",
       "      <td>1.24685</td>\n",
       "      <td>model</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,3)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,3)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>70</td>\n",
       "      <td>1.24685</td>\n",
       "      <td>level1</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,3)</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,3)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,2)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)U(L2,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>470</td>\n",
       "      <td>268.977997</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>S(L1,L2,1,1)</td>\n",
       "      <td>S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,2)P(L1)T2(L0,L1,128,32)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>470</td>\n",
       "      <td>268.977997</td>\n",
       "      <td>model</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>S(L1,L2,1,1)</td>\n",
       "      <td>S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,2)P(L1)T2(L0,L1,128,32)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>470</td>\n",
       "      <td>268.977997</td>\n",
       "      <td>level1</td>\n",
       "      <td>I(L1,L2)S(L1,L2,1,1)</td>\n",
       "      <td>S(L1,L2,1,1)</td>\n",
       "      <td>S(L1,L2,1,1)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,2)P(L1)T2(L0,L1,128,32)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)T2(L0,L1,128,32)U(L4,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>734</td>\n",
       "      <td>17424.0</td>\n",
       "      <td>execution</td>\n",
       "      <td>T2(L1,L2,32,32)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>734</td>\n",
       "      <td>17424.0</td>\n",
       "      <td>model</td>\n",
       "      <td>T2(L1,L2,32,32)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>734</td>\n",
       "      <td>17424.0</td>\n",
       "      <td>level1</td>\n",
       "      <td>T2(L1,L2,32,32)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>23.0481</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>23.0481</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>23.0481</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td>16</td>\n",
       "      <td>0.040832</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td>16</td>\n",
       "      <td>0.040832</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td>16</td>\n",
       "      <td>0.040832</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td>10</td>\n",
       "      <td>0.00403</td>\n",
       "      <td>execution</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td>10</td>\n",
       "      <td>0.00403</td>\n",
       "      <td>model</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td>10</td>\n",
       "      <td>0.00403</td>\n",
       "      <td>level1</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "      <td>U(L1,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td>46</td>\n",
       "      <td>0.407311</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td>46</td>\n",
       "      <td>0.407311</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td>46</td>\n",
       "      <td>0.407311</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "      <td>S(L0,L1,2,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>5.72876</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>5.72876</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>5.72876</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "      <td>S(L0,L1,3,1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>220</td>\n",
       "      <td>21.564301</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)S(L2,L3,1,2)</td>\n",
       "      <td>I(L1,L2)U(L3,16)</td>\n",
       "      <td>I(L1,L2)U(L3,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>220</td>\n",
       "      <td>21.564301</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L2,L3,1,1)</td>\n",
       "      <td>I(L1,L2)U(L3,16)</td>\n",
       "      <td>I(L1,L2)U(L3,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>220</td>\n",
       "      <td>21.564301</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L2,L3,1,1)</td>\n",
       "      <td>I(L1,L2)U(L3,16)</td>\n",
       "      <td>I(L1,L2)U(L3,16)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,16)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>168</td>\n",
       "      <td>1.71655</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)S(L2,L3,1,1)</td>\n",
       "      <td>S(L1,L2,1,1)U(L3,4)</td>\n",
       "      <td>S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>U(L3,4)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>168</td>\n",
       "      <td>1.71655</td>\n",
       "      <td>model</td>\n",
       "      <td>I(L2,L3)S(L2,L3,1,2)</td>\n",
       "      <td>S(L1,L2,1,1)U(L3,4)</td>\n",
       "      <td>S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>U(L3,4)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>168</td>\n",
       "      <td>1.71655</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>S(L1,L2,1,1)U(L3,4)</td>\n",
       "      <td>S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>I(L1,L2)S(L0,L1,3,1)U(L3,8)</td>\n",
       "      <td>U(L3,4)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>300</td>\n",
       "      <td>197.315994</td>\n",
       "      <td>execution</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>U(L3,16)</td>\n",
       "      <td>I(L2,L3)S(L0,L1,3,1)P(L1)U(L3,16)</td>\n",
       "      <td>I(L2,L3)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)U(L3,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>300</td>\n",
       "      <td>197.315994</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>U(L3,16)</td>\n",
       "      <td>I(L2,L3)S(L0,L1,3,1)P(L1)U(L3,16)</td>\n",
       "      <td>I(L2,L3)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)U(L3,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>300</td>\n",
       "      <td>197.315994</td>\n",
       "      <td>level1</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>S(L2,L3,1,2)</td>\n",
       "      <td>U(L3,16)</td>\n",
       "      <td>I(L2,L3)S(L0,L1,3,1)P(L1)U(L3,16)</td>\n",
       "      <td>I(L2,L3)S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)U(L3,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>57</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>1468</td>\n",
       "      <td>20338.800781</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L1,L2)S(L0,L1,2,1)P(L1)T2(L2,L3,64,32)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>1468</td>\n",
       "      <td>20338.800781</td>\n",
       "      <td>model</td>\n",
       "      <td>S(L0,L1,3,1)P(L1)U(L3,16)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>1468</td>\n",
       "      <td>20338.800781</td>\n",
       "      <td>level1</td>\n",
       "      <td>I(L2,L3)S(L2,L3,1,3)T2(L1,L2,32,128)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "      <td>S(L0,L1,2,1)P(L1)U(L3,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>20.381001</td>\n",
       "      <td>execution</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>20.381001</td>\n",
       "      <td>model</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>20.381001</td>\n",
       "      <td>level1</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>36</td>\n",
       "      <td>0.010014</td>\n",
       "      <td>execution</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>36</td>\n",
       "      <td>0.010014</td>\n",
       "      <td>model</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>36</td>\n",
       "      <td>0.010014</td>\n",
       "      <td>level1</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>21</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>execution</td>\n",
       "      <td></td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>21</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>model</td>\n",
       "      <td></td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>21</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>level1</td>\n",
       "      <td></td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "      <td>I(L0,L1)U(L1,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>78</td>\n",
       "      <td>0.096483</td>\n",
       "      <td>execution</td>\n",
       "      <td></td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>78</td>\n",
       "      <td>0.096483</td>\n",
       "      <td>model</td>\n",
       "      <td></td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>78</td>\n",
       "      <td>0.096483</td>\n",
       "      <td>level1</td>\n",
       "      <td></td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "      <td>P(L0)T2(L0,L1,64,128)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>72</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>3.12811</td>\n",
       "      <td>execution</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>73</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>3.12811</td>\n",
       "      <td>model</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>3.12811</td>\n",
       "      <td>level1</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "      <td>P(L0)T2(L0,L1,32,64)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>17.4445</td>\n",
       "      <td>execution</td>\n",
       "      <td>P(L1)T2(L1,L2,32,64)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>17.4445</td>\n",
       "      <td>model</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>17.4445</td>\n",
       "      <td>level1</td>\n",
       "      <td>P(L1)T2(L1,L2,32,64)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>52</td>\n",
       "      <td>0.014422</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>52</td>\n",
       "      <td>0.014422</td>\n",
       "      <td>model</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>52</td>\n",
       "      <td>0.014422</td>\n",
       "      <td>level1</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>48</td>\n",
       "      <td>0.00276</td>\n",
       "      <td>execution</td>\n",
       "      <td>I(L0,L1)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>48</td>\n",
       "      <td>0.00276</td>\n",
       "      <td>model</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>48</td>\n",
       "      <td>0.00276</td>\n",
       "      <td>level1</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "      <td>I(L1,L2)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>124</td>\n",
       "      <td>0.114715</td>\n",
       "      <td>execution</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>124</td>\n",
       "      <td>0.114715</td>\n",
       "      <td>model</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>124</td>\n",
       "      <td>0.114715</td>\n",
       "      <td>level1</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>P(L0)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>3.2137</td>\n",
       "      <td>execution</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>3.2137</td>\n",
       "      <td>model</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>3.2137</td>\n",
       "      <td>level1</td>\n",
       "      <td>P(L0)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "      <td>I(L0,L1)P(L0)U(L2,8)</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        name nb_scheds     base_time  eval_mode  \\\n",
       "0    function_seidel2d_SMALL        41       7.01036  execution   \n",
       "1    function_seidel2d_SMALL        41       7.01036      model   \n",
       "2    function_seidel2d_SMALL        41       7.01036     level1   \n",
       "3     function_seidel2d_MINI        35      0.835829  execution   \n",
       "4     function_seidel2d_MINI        35      0.835829      model   \n",
       "5     function_seidel2d_MINI        35      0.835829     level1   \n",
       "6   function_seidel2d_MEDIUM       227    232.917999  execution   \n",
       "7   function_seidel2d_MEDIUM       227    232.917999      model   \n",
       "8   function_seidel2d_MEDIUM       227    232.917999     level1   \n",
       "9    function_seidel2d_LARGE       359       19681.5  execution   \n",
       "10   function_seidel2d_LARGE       359       19681.5      model   \n",
       "11   function_seidel2d_LARGE       359       19681.5     level1   \n",
       "12     function_matmul_SMALL       762      0.946007  execution   \n",
       "13     function_matmul_SMALL       762      0.946007      model   \n",
       "14     function_matmul_SMALL       762      0.946007     level1   \n",
       "15      function_matmul_MINI        99      0.026936  execution   \n",
       "16      function_matmul_MINI        99      0.026936      model   \n",
       "17      function_matmul_MINI        99      0.026936     level1   \n",
       "18    function_matmul_MEDIUM      3432     33.081902  execution   \n",
       "19    function_matmul_MEDIUM      3432     33.081902      model   \n",
       "20    function_matmul_MEDIUM      3432     33.081902     level1   \n",
       "21   function_jacobi2d_SMALL       100       7.21077  execution   \n",
       "22   function_jacobi2d_SMALL       100       7.21077      model   \n",
       "23   function_jacobi2d_SMALL       100       7.21077     level1   \n",
       "24    function_jacobi2d_MINI        70       1.24685  execution   \n",
       "25    function_jacobi2d_MINI        70       1.24685      model   \n",
       "26    function_jacobi2d_MINI        70       1.24685     level1   \n",
       "27  function_jacobi2d_MEDIUM       470    268.977997  execution   \n",
       "28  function_jacobi2d_MEDIUM       470    268.977997      model   \n",
       "29  function_jacobi2d_MEDIUM       470    268.977997     level1   \n",
       "30   function_jacobi2d_LARGE       734       17424.0  execution   \n",
       "31   function_jacobi2d_LARGE       734       17424.0      model   \n",
       "32   function_jacobi2d_LARGE       734       17424.0     level1   \n",
       "33  function_jacobi1d_XLARGE        64       23.0481  execution   \n",
       "34  function_jacobi1d_XLARGE        64       23.0481      model   \n",
       "35  function_jacobi1d_XLARGE        64       23.0481     level1   \n",
       "36   function_jacobi1d_SMALL        16      0.040832  execution   \n",
       "37   function_jacobi1d_SMALL        16      0.040832      model   \n",
       "38   function_jacobi1d_SMALL        16      0.040832     level1   \n",
       "39    function_jacobi1d_MINI        10       0.00403  execution   \n",
       "40    function_jacobi1d_MINI        10       0.00403      model   \n",
       "41    function_jacobi1d_MINI        10       0.00403     level1   \n",
       "42  function_jacobi1d_MEDIUM        46      0.407311  execution   \n",
       "43  function_jacobi1d_MEDIUM        46      0.407311      model   \n",
       "44  function_jacobi1d_MEDIUM        46      0.407311     level1   \n",
       "45   function_jacobi1d_LARGE        64       5.72876  execution   \n",
       "46   function_jacobi1d_LARGE        64       5.72876      model   \n",
       "47   function_jacobi1d_LARGE        64       5.72876     level1   \n",
       "48     function_heat3d_SMALL       220     21.564301  execution   \n",
       "49     function_heat3d_SMALL       220     21.564301      model   \n",
       "50     function_heat3d_SMALL       220     21.564301     level1   \n",
       "51      function_heat3d_MINI       168       1.71655  execution   \n",
       "52      function_heat3d_MINI       168       1.71655      model   \n",
       "53      function_heat3d_MINI       168       1.71655     level1   \n",
       "54    function_heat3d_MEDIUM       300    197.315994  execution   \n",
       "55    function_heat3d_MEDIUM       300    197.315994      model   \n",
       "56    function_heat3d_MEDIUM       300    197.315994     level1   \n",
       "57     function_heat3d_LARGE      1468  20338.800781  execution   \n",
       "58     function_heat3d_LARGE      1468  20338.800781      model   \n",
       "59     function_heat3d_LARGE      1468  20338.800781     level1   \n",
       "60    function_heat2d_XLARGE        78     20.381001  execution   \n",
       "61    function_heat2d_XLARGE        78     20.381001      model   \n",
       "62    function_heat2d_XLARGE        78     20.381001     level1   \n",
       "63     function_heat2d_SMALL        36      0.010014  execution   \n",
       "64     function_heat2d_SMALL        36      0.010014      model   \n",
       "65     function_heat2d_SMALL        36      0.010014     level1   \n",
       "66      function_heat2d_MINI        21      0.001186  execution   \n",
       "67      function_heat2d_MINI        21      0.001186      model   \n",
       "68      function_heat2d_MINI        21      0.001186     level1   \n",
       "69    function_heat2d_MEDIUM        78      0.096483  execution   \n",
       "70    function_heat2d_MEDIUM        78      0.096483      model   \n",
       "71    function_heat2d_MEDIUM        78      0.096483     level1   \n",
       "72     function_heat2d_LARGE        78       3.12811  execution   \n",
       "73     function_heat2d_LARGE        78       3.12811      model   \n",
       "74     function_heat2d_LARGE        78       3.12811     level1   \n",
       "75      function_blur_XLARGE       160       17.4445  execution   \n",
       "76      function_blur_XLARGE       160       17.4445      model   \n",
       "77      function_blur_XLARGE       160       17.4445     level1   \n",
       "78       function_blur_SMALL        52      0.014422  execution   \n",
       "79       function_blur_SMALL        52      0.014422      model   \n",
       "80       function_blur_SMALL        52      0.014422     level1   \n",
       "81        function_blur_MINI        48       0.00276  execution   \n",
       "82        function_blur_MINI        48       0.00276      model   \n",
       "83        function_blur_MINI        48       0.00276     level1   \n",
       "84      function_blur_MEDIUM       124      0.114715  execution   \n",
       "85      function_blur_MEDIUM       124      0.114715      model   \n",
       "86      function_blur_MEDIUM       124      0.114715     level1   \n",
       "87       function_blur_LARGE       160        3.2137  execution   \n",
       "88       function_blur_LARGE       160        3.2137      model   \n",
       "89       function_blur_LARGE       160        3.2137     level1   \n",
       "\n",
       "                                        bs=1  \\\n",
       "0                               S(L1,L2,3,2)   \n",
       "1                               S(L1,L2,3,2)   \n",
       "2                               S(L1,L2,3,2)   \n",
       "3                               S(L1,L2,3,1)   \n",
       "4                               S(L1,L2,3,1)   \n",
       "5                               S(L1,L2,3,1)   \n",
       "6                               S(L1,L2,3,1)   \n",
       "7                               S(L1,L2,3,1)   \n",
       "8                               S(L1,L2,3,1)   \n",
       "9                          S(L0,L1,3,2)P(L1)   \n",
       "10                         S(L0,L1,3,2)P(L1)   \n",
       "11                         S(L0,L1,3,2)P(L1)   \n",
       "12      I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "13         P(L0)T3(L0,L1,L2,32,64,32)U(L5,4)   \n",
       "14         P(L0)T3(L0,L1,L2,32,64,32)U(L5,4)   \n",
       "15                          I(L1,L2)U(L2,16)   \n",
       "16                          I(L1,L2)U(L2,16)   \n",
       "17                          I(L1,L2)U(L2,16)   \n",
       "18             I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "19         S(L1,L2,1,2)P(L0)T2(L1,L2,128,32)   \n",
       "20         S(L1,L2,1,2)P(L0)T2(L1,L2,128,32)   \n",
       "21                      I(L1,L2)S(L1,L2,1,1)   \n",
       "22                      I(L1,L2)S(L1,L2,1,1)   \n",
       "23                      I(L1,L2)S(L1,L2,1,1)   \n",
       "24                      I(L1,L2)S(L1,L2,1,3)   \n",
       "25                      I(L1,L2)S(L1,L2,1,3)   \n",
       "26                      I(L1,L2)S(L1,L2,1,3)   \n",
       "27                      I(L1,L2)S(L1,L2,1,1)   \n",
       "28                      I(L1,L2)S(L1,L2,1,1)   \n",
       "29                      I(L1,L2)S(L1,L2,1,1)   \n",
       "30                           T2(L1,L2,32,32)   \n",
       "31                           T2(L1,L2,32,32)   \n",
       "32                           T2(L1,L2,32,32)   \n",
       "33                              S(L0,L1,2,1)   \n",
       "34                              S(L0,L1,2,1)   \n",
       "35                              S(L0,L1,2,1)   \n",
       "36                              S(L0,L1,2,1)   \n",
       "37                              S(L0,L1,2,1)   \n",
       "38                              S(L0,L1,2,1)   \n",
       "39                                   U(L1,8)   \n",
       "40                                   U(L1,8)   \n",
       "41                                   U(L1,8)   \n",
       "42                              S(L0,L1,2,1)   \n",
       "43                              S(L0,L1,2,1)   \n",
       "44                              S(L0,L1,2,1)   \n",
       "45                              S(L0,L1,3,1)   \n",
       "46                              S(L0,L1,3,1)   \n",
       "47                              S(L0,L1,3,1)   \n",
       "48                      I(L1,L2)S(L2,L3,1,2)   \n",
       "49                              S(L2,L3,1,1)   \n",
       "50                              S(L2,L3,1,1)   \n",
       "51                      I(L1,L2)S(L2,L3,1,1)   \n",
       "52                      I(L2,L3)S(L2,L3,1,2)   \n",
       "53                              S(L2,L3,1,2)   \n",
       "54                              S(L2,L3,1,2)   \n",
       "55                              S(L2,L3,1,2)   \n",
       "56                              S(L2,L3,1,2)   \n",
       "57  I(L1,L2)S(L0,L1,2,1)P(L1)T2(L2,L3,64,32)   \n",
       "58                 S(L0,L1,3,1)P(L1)U(L3,16)   \n",
       "59      I(L2,L3)S(L2,L3,1,3)T2(L1,L2,32,128)   \n",
       "60                      P(L0)T2(L0,L1,32,64)   \n",
       "61                      P(L0)T2(L0,L1,32,64)   \n",
       "62                      P(L0)T2(L0,L1,32,64)   \n",
       "63                                             \n",
       "64                                             \n",
       "65                                             \n",
       "66                                             \n",
       "67                                             \n",
       "68                                             \n",
       "69                                             \n",
       "70                                             \n",
       "71                                             \n",
       "72                      P(L0)T2(L0,L1,32,64)   \n",
       "73                      P(L0)T2(L0,L1,32,64)   \n",
       "74                      P(L0)T2(L0,L1,32,64)   \n",
       "75                      P(L1)T2(L1,L2,32,64)   \n",
       "76                      I(L0,L1)P(L0)U(L2,8)   \n",
       "77                      P(L1)T2(L1,L2,32,64)   \n",
       "78                                  I(L0,L1)   \n",
       "79                                     P(L0)   \n",
       "80                                     P(L0)   \n",
       "81                                  I(L0,L1)   \n",
       "82                                     P(L0)   \n",
       "83                                     P(L0)   \n",
       "84                                     P(L0)   \n",
       "85                                     P(L0)   \n",
       "86                                     P(L0)   \n",
       "87                                     P(L0)   \n",
       "88                      I(L0,L1)P(L0)U(L2,8)   \n",
       "89                                     P(L0)   \n",
       "\n",
       "                                       bs=2  \\\n",
       "0                              S(L1,L2,3,2)   \n",
       "1                              S(L1,L2,3,2)   \n",
       "2                              S(L1,L2,3,2)   \n",
       "3                              S(L1,L2,3,1)   \n",
       "4                              S(L1,L2,3,1)   \n",
       "5                              S(L1,L2,3,1)   \n",
       "6               S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "7               S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "8               S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "9                  S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "10                 S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "11                 S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "12     I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "13        P(L0)T3(L0,L1,L2,32,64,32)U(L5,4)   \n",
       "14     I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "15                         I(L1,L2)U(L2,16)   \n",
       "16                         I(L1,L2)U(L2,16)   \n",
       "17                         I(L1,L2)U(L2,16)   \n",
       "18            I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "19        S(L1,L2,1,1)P(L0)T2(L1,L2,128,32)   \n",
       "20        S(L1,L2,1,1)P(L0)T2(L1,L2,128,32)   \n",
       "21                     I(L1,L2)S(L1,L2,1,1)   \n",
       "22                     I(L1,L2)S(L1,L2,1,1)   \n",
       "23                     I(L1,L2)S(L1,L2,1,1)   \n",
       "24                     I(L1,L2)S(L1,L2,1,3)   \n",
       "25                     I(L1,L2)S(L1,L2,1,3)   \n",
       "26                     I(L1,L2)S(L1,L2,1,3)   \n",
       "27                             S(L1,L2,1,1)   \n",
       "28                             S(L1,L2,1,1)   \n",
       "29                             S(L1,L2,1,1)   \n",
       "30  S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)   \n",
       "31  S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)   \n",
       "32  S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)   \n",
       "33                             S(L0,L1,2,1)   \n",
       "34                             S(L0,L1,2,1)   \n",
       "35                             S(L0,L1,2,1)   \n",
       "36                             S(L0,L1,2,1)   \n",
       "37                             S(L0,L1,2,1)   \n",
       "38                             S(L0,L1,2,1)   \n",
       "39                                  U(L1,8)   \n",
       "40                                  U(L1,8)   \n",
       "41                                  U(L1,8)   \n",
       "42                             S(L0,L1,2,1)   \n",
       "43                             S(L0,L1,2,1)   \n",
       "44                             S(L0,L1,2,1)   \n",
       "45                             S(L0,L1,3,1)   \n",
       "46                             S(L0,L1,3,1)   \n",
       "47                             S(L0,L1,3,1)   \n",
       "48                         I(L1,L2)U(L3,16)   \n",
       "49                         I(L1,L2)U(L3,16)   \n",
       "50                         I(L1,L2)U(L3,16)   \n",
       "51                      S(L1,L2,1,1)U(L3,4)   \n",
       "52                      S(L1,L2,1,1)U(L3,4)   \n",
       "53                      S(L1,L2,1,1)U(L3,4)   \n",
       "54                             S(L2,L3,1,2)   \n",
       "55                             S(L2,L3,1,2)   \n",
       "56                             S(L2,L3,1,2)   \n",
       "57                 S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "58                 S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "59                 S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "60                     P(L0)T2(L0,L1,32,64)   \n",
       "61                     P(L0)T2(L0,L1,32,64)   \n",
       "62                     P(L0)T2(L0,L1,32,64)   \n",
       "63                                            \n",
       "64                                            \n",
       "65                                            \n",
       "66                          I(L0,L1)U(L1,8)   \n",
       "67                          I(L0,L1)U(L1,8)   \n",
       "68                          I(L0,L1)U(L1,8)   \n",
       "69                    P(L0)T2(L0,L1,64,128)   \n",
       "70                    P(L0)T2(L0,L1,64,128)   \n",
       "71                    P(L0)T2(L0,L1,64,128)   \n",
       "72                     P(L0)T2(L0,L1,32,64)   \n",
       "73                     P(L0)T2(L0,L1,32,64)   \n",
       "74                     P(L0)T2(L0,L1,32,64)   \n",
       "75                     I(L0,L1)P(L0)U(L2,8)   \n",
       "76                     I(L0,L1)P(L0)U(L2,8)   \n",
       "77                     I(L0,L1)P(L0)U(L2,8)   \n",
       "78                                 I(L0,L1)   \n",
       "79                                 I(L0,L1)   \n",
       "80                                 I(L0,L1)   \n",
       "81                                    P(L0)   \n",
       "82                                    P(L0)   \n",
       "83                                    P(L0)   \n",
       "84                                    P(L0)   \n",
       "85                                    P(L0)   \n",
       "86                                    P(L0)   \n",
       "87                     I(L0,L1)P(L0)U(L2,8)   \n",
       "88                     I(L0,L1)P(L0)U(L2,8)   \n",
       "89                     I(L0,L1)P(L0)U(L2,8)   \n",
       "\n",
       "                                       bs=3  \\\n",
       "0               S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "1               S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "2               S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "3                              S(L1,L2,3,1)   \n",
       "4                              S(L1,L2,3,1)   \n",
       "5                              S(L1,L2,3,1)   \n",
       "6               S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "7               S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "8               S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "9                  S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "10                 S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "11                 S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "12     I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "13     I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "14     I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "15                         I(L1,L2)U(L2,16)   \n",
       "16                         I(L1,L2)U(L2,16)   \n",
       "17                         I(L1,L2)U(L2,16)   \n",
       "18            I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "19            I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "20            I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "21                     I(L1,L2)S(L1,L2,1,1)   \n",
       "22                     I(L1,L2)S(L1,L2,1,1)   \n",
       "23                     I(L1,L2)S(L1,L2,1,1)   \n",
       "24             I(L1,L2)S(L0,L1,3,2)U(L2,16)   \n",
       "25             I(L1,L2)S(L0,L1,3,2)U(L2,16)   \n",
       "26             I(L1,L2)S(L0,L1,3,2)U(L2,16)   \n",
       "27                             S(L1,L2,1,1)   \n",
       "28                             S(L1,L2,1,1)   \n",
       "29                             S(L1,L2,1,1)   \n",
       "30  S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)   \n",
       "31  S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)   \n",
       "32  S(L0,L1,2,1)P(L1)T2(L0,L1,32,32)U(L4,8)   \n",
       "33                             S(L0,L1,2,1)   \n",
       "34                             S(L0,L1,2,1)   \n",
       "35                             S(L0,L1,2,1)   \n",
       "36                             S(L0,L1,2,1)   \n",
       "37                             S(L0,L1,2,1)   \n",
       "38                             S(L0,L1,2,1)   \n",
       "39                                  U(L1,8)   \n",
       "40                                  U(L1,8)   \n",
       "41                                  U(L1,8)   \n",
       "42                             S(L0,L1,2,1)   \n",
       "43                             S(L0,L1,2,1)   \n",
       "44                             S(L0,L1,2,1)   \n",
       "45                             S(L0,L1,3,1)   \n",
       "46                             S(L0,L1,3,1)   \n",
       "47                             S(L0,L1,3,1)   \n",
       "48                         I(L1,L2)U(L3,16)   \n",
       "49                         I(L1,L2)U(L3,16)   \n",
       "50                         I(L1,L2)U(L3,16)   \n",
       "51                      S(L0,L1,3,1)U(L3,8)   \n",
       "52                      S(L0,L1,3,1)U(L3,8)   \n",
       "53                      S(L0,L1,3,1)U(L3,8)   \n",
       "54                             S(L2,L3,1,2)   \n",
       "55                             S(L2,L3,1,2)   \n",
       "56                             S(L2,L3,1,2)   \n",
       "57                 S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "58                 S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "59                 S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "60                     P(L0)T2(L0,L1,32,64)   \n",
       "61                     P(L0)T2(L0,L1,32,64)   \n",
       "62                     P(L0)T2(L0,L1,32,64)   \n",
       "63                                            \n",
       "64                                            \n",
       "65                                            \n",
       "66                          I(L0,L1)U(L1,8)   \n",
       "67                          I(L0,L1)U(L1,8)   \n",
       "68                          I(L0,L1)U(L1,8)   \n",
       "69                    P(L0)T2(L0,L1,64,128)   \n",
       "70                    P(L0)T2(L0,L1,64,128)   \n",
       "71                    P(L0)T2(L0,L1,64,128)   \n",
       "72                     P(L0)T2(L0,L1,32,64)   \n",
       "73                     P(L0)T2(L0,L1,32,64)   \n",
       "74                     P(L0)T2(L0,L1,32,64)   \n",
       "75                     I(L0,L1)P(L0)U(L2,8)   \n",
       "76                     I(L0,L1)P(L0)U(L2,8)   \n",
       "77                     I(L0,L1)P(L0)U(L2,8)   \n",
       "78                                 I(L0,L1)   \n",
       "79                                 I(L0,L1)   \n",
       "80                                 I(L0,L1)   \n",
       "81                                    P(L0)   \n",
       "82                          I(L1,L2)U(L2,8)   \n",
       "83                          I(L1,L2)U(L2,8)   \n",
       "84                                    P(L0)   \n",
       "85                                    P(L0)   \n",
       "86                                    P(L0)   \n",
       "87                     I(L0,L1)P(L0)U(L2,8)   \n",
       "88                     I(L0,L1)P(L0)U(L2,8)   \n",
       "89                     I(L0,L1)P(L0)U(L2,8)   \n",
       "\n",
       "                                         bs=4  \\\n",
       "0                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "1                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "2                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "3                                S(L1,L2,3,1)   \n",
       "4                                S(L1,L2,3,1)   \n",
       "5                                S(L1,L2,3,1)   \n",
       "6                 S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "7                 S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "8                 S(L1,L2,3,2)T2(L1,L2,32,64)   \n",
       "9                    S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "10                   S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "11                   S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "12       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "13       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "14       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "15                           I(L1,L2)U(L2,16)   \n",
       "16                           I(L1,L2)U(L2,16)   \n",
       "17                           I(L1,L2)U(L2,16)   \n",
       "18              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "19              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "20              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "21                           I(L1,L2)U(L2,16)   \n",
       "22                           I(L1,L2)U(L2,16)   \n",
       "23                           I(L1,L2)U(L2,16)   \n",
       "24               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "25               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "26               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "27  I(L1,L2)S(L0,L1,3,2)P(L1)T2(L0,L1,128,32)   \n",
       "28  I(L1,L2)S(L0,L1,3,2)P(L1)T2(L0,L1,128,32)   \n",
       "29  I(L1,L2)S(L0,L1,3,2)P(L1)T2(L0,L1,128,32)   \n",
       "30   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "31   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "32   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "33                               S(L0,L1,2,1)   \n",
       "34                               S(L0,L1,2,1)   \n",
       "35                               S(L0,L1,2,1)   \n",
       "36                               S(L0,L1,2,1)   \n",
       "37                               S(L0,L1,2,1)   \n",
       "38                               S(L0,L1,2,1)   \n",
       "39                                    U(L1,8)   \n",
       "40                                    U(L1,8)   \n",
       "41                                    U(L1,8)   \n",
       "42                               S(L0,L1,2,1)   \n",
       "43                               S(L0,L1,2,1)   \n",
       "44                               S(L0,L1,2,1)   \n",
       "45                               S(L0,L1,3,1)   \n",
       "46                               S(L0,L1,3,1)   \n",
       "47                               S(L0,L1,3,1)   \n",
       "48           I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "49           I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "50           I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "51                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "52                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "53                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "54                                   U(L3,16)   \n",
       "55                                   U(L3,16)   \n",
       "56                                   U(L3,16)   \n",
       "57                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "58                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "59                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "60                       P(L0)T2(L0,L1,32,64)   \n",
       "61                       P(L0)T2(L0,L1,32,64)   \n",
       "62                       P(L0)T2(L0,L1,32,64)   \n",
       "63                                              \n",
       "64                                              \n",
       "65                                              \n",
       "66                            I(L0,L1)U(L1,8)   \n",
       "67                            I(L0,L1)U(L1,8)   \n",
       "68                            I(L0,L1)U(L1,8)   \n",
       "69                      P(L0)T2(L0,L1,64,128)   \n",
       "70                      P(L0)T2(L0,L1,64,128)   \n",
       "71                      P(L0)T2(L0,L1,64,128)   \n",
       "72                       P(L0)T2(L0,L1,32,64)   \n",
       "73                       P(L0)T2(L0,L1,32,64)   \n",
       "74                       P(L0)T2(L0,L1,32,64)   \n",
       "75                       I(L0,L1)P(L0)U(L2,8)   \n",
       "76                       I(L0,L1)P(L0)U(L2,8)   \n",
       "77                       I(L0,L1)P(L0)U(L2,8)   \n",
       "78                                   I(L0,L1)   \n",
       "79                                   I(L0,L1)   \n",
       "80                                   I(L0,L1)   \n",
       "81                            I(L1,L2)U(L2,8)   \n",
       "82                            I(L1,L2)U(L2,8)   \n",
       "83                            I(L1,L2)U(L2,8)   \n",
       "84                                      P(L0)   \n",
       "85                                      P(L0)   \n",
       "86                                      P(L0)   \n",
       "87                       I(L0,L1)P(L0)U(L2,8)   \n",
       "88                       I(L0,L1)P(L0)U(L2,8)   \n",
       "89                       I(L0,L1)P(L0)U(L2,8)   \n",
       "\n",
       "                                                bs=5  \\\n",
       "0                        S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "1                        S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "2                        S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "3                                       S(L1,L2,3,1)   \n",
       "4                                       S(L1,L2,3,1)   \n",
       "5                                       S(L1,L2,3,1)   \n",
       "6          S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "7          S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "8          S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "9                           S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "10                          S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "11                          S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "12              I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "13              I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "14              I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "15                                  I(L1,L2)U(L2,16)   \n",
       "16                                  I(L1,L2)U(L2,16)   \n",
       "17                                  I(L1,L2)U(L2,16)   \n",
       "18                     I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "19                     I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "20                     I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "21                      I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "22                      I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "23                      I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "24                      I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "25                      I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "26                      I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "27  I(L1,L2)S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "28  I(L1,L2)S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "29  I(L1,L2)S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "30          S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "31          S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "32          S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "33                                      S(L0,L1,2,1)   \n",
       "34                                      S(L0,L1,2,1)   \n",
       "35                                      S(L0,L1,2,1)   \n",
       "36                                      S(L0,L1,2,1)   \n",
       "37                                      S(L0,L1,2,1)   \n",
       "38                                      S(L0,L1,2,1)   \n",
       "39                                           U(L1,8)   \n",
       "40                                           U(L1,8)   \n",
       "41                                           U(L1,8)   \n",
       "42                                      S(L0,L1,2,1)   \n",
       "43                                      S(L0,L1,2,1)   \n",
       "44                                      S(L0,L1,2,1)   \n",
       "45                                      S(L0,L1,3,1)   \n",
       "46                                      S(L0,L1,3,1)   \n",
       "47                                      S(L0,L1,3,1)   \n",
       "48                  I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "49                  I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "50                  I(L1,L2)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "51                       I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "52                       I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "53                       I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "54                 I(L2,L3)S(L0,L1,3,1)P(L1)U(L3,16)   \n",
       "55                 I(L2,L3)S(L0,L1,3,1)P(L1)U(L3,16)   \n",
       "56                 I(L2,L3)S(L0,L1,3,1)P(L1)U(L3,16)   \n",
       "57                          S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "58                          S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "59                          S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "60                              P(L0)T2(L0,L1,32,64)   \n",
       "61                              P(L0)T2(L0,L1,32,64)   \n",
       "62                              P(L0)T2(L0,L1,32,64)   \n",
       "63                                                     \n",
       "64                                                     \n",
       "65                                                     \n",
       "66                                   I(L0,L1)U(L1,8)   \n",
       "67                                   I(L0,L1)U(L1,8)   \n",
       "68                                   I(L0,L1)U(L1,8)   \n",
       "69                             P(L0)T2(L0,L1,64,128)   \n",
       "70                             P(L0)T2(L0,L1,64,128)   \n",
       "71                             P(L0)T2(L0,L1,64,128)   \n",
       "72                              P(L0)T2(L0,L1,32,64)   \n",
       "73                              P(L0)T2(L0,L1,32,64)   \n",
       "74                              P(L0)T2(L0,L1,32,64)   \n",
       "75                              I(L0,L1)P(L0)U(L2,8)   \n",
       "76                              I(L0,L1)P(L0)U(L2,8)   \n",
       "77                              I(L0,L1)P(L0)U(L2,8)   \n",
       "78                                          I(L0,L1)   \n",
       "79                                          I(L0,L1)   \n",
       "80                                          I(L0,L1)   \n",
       "81                                   I(L1,L2)U(L2,8)   \n",
       "82                                   I(L1,L2)U(L2,8)   \n",
       "83                                   I(L1,L2)U(L2,8)   \n",
       "84                                             P(L0)   \n",
       "85                                             P(L0)   \n",
       "86                                             P(L0)   \n",
       "87                              I(L0,L1)P(L0)U(L2,8)   \n",
       "88                              I(L0,L1)P(L0)U(L2,8)   \n",
       "89                              I(L0,L1)P(L0)U(L2,8)   \n",
       "\n",
       "                                         bs=6  \\\n",
       "0                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "1                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "2                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "3                         S(L0,L1,2,1)U(L2,8)   \n",
       "4                         S(L0,L1,2,1)U(L2,8)   \n",
       "5                         S(L0,L1,2,1)U(L2,8)   \n",
       "6   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "7   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "8   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "9                    S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "10                   S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "11                   S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "12       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "13       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "14       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "15                           I(L1,L2)U(L2,16)   \n",
       "16                           I(L1,L2)U(L2,16)   \n",
       "17                           I(L1,L2)U(L2,16)   \n",
       "18              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "19              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "20              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "21               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "22               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "23               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "24               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "25               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "26               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "27  S(L0,L1,3,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "28  S(L0,L1,3,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "29  S(L0,L1,3,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "30   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "31   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "32   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "33                               S(L0,L1,2,1)   \n",
       "34                               S(L0,L1,2,1)   \n",
       "35                               S(L0,L1,2,1)   \n",
       "36                               S(L0,L1,2,1)   \n",
       "37                               S(L0,L1,2,1)   \n",
       "38                               S(L0,L1,2,1)   \n",
       "39                                    U(L1,8)   \n",
       "40                                    U(L1,8)   \n",
       "41                                    U(L1,8)   \n",
       "42                               S(L0,L1,2,1)   \n",
       "43                               S(L0,L1,2,1)   \n",
       "44                               S(L0,L1,2,1)   \n",
       "45                               S(L0,L1,3,1)   \n",
       "46                               S(L0,L1,3,1)   \n",
       "47                               S(L0,L1,3,1)   \n",
       "48                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "49                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "50                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "51                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "52                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "53                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "54           I(L2,L3)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "55           I(L2,L3)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "56           I(L2,L3)S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "57                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "58                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "59                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "60                       P(L0)T2(L0,L1,32,64)   \n",
       "61                       P(L0)T2(L0,L1,32,64)   \n",
       "62                       P(L0)T2(L0,L1,32,64)   \n",
       "63                                              \n",
       "64                                              \n",
       "65                                              \n",
       "66                            I(L0,L1)U(L1,8)   \n",
       "67                            I(L0,L1)U(L1,8)   \n",
       "68                            I(L0,L1)U(L1,8)   \n",
       "69                      P(L0)T2(L0,L1,64,128)   \n",
       "70                      P(L0)T2(L0,L1,64,128)   \n",
       "71                      P(L0)T2(L0,L1,64,128)   \n",
       "72                       P(L0)T2(L0,L1,32,64)   \n",
       "73                       P(L0)T2(L0,L1,32,64)   \n",
       "74                       P(L0)T2(L0,L1,32,64)   \n",
       "75                       I(L0,L1)P(L0)U(L2,8)   \n",
       "76                       I(L0,L1)P(L0)U(L2,8)   \n",
       "77                       I(L0,L1)P(L0)U(L2,8)   \n",
       "78                                   I(L0,L1)   \n",
       "79                                   I(L0,L1)   \n",
       "80                                   I(L0,L1)   \n",
       "81                            I(L1,L2)U(L2,8)   \n",
       "82                            I(L1,L2)U(L2,8)   \n",
       "83                            I(L1,L2)U(L2,8)   \n",
       "84                                      P(L0)   \n",
       "85                                      P(L0)   \n",
       "86                                      P(L0)   \n",
       "87                       I(L0,L1)P(L0)U(L2,8)   \n",
       "88                       I(L0,L1)P(L0)U(L2,8)   \n",
       "89                       I(L0,L1)P(L0)U(L2,8)   \n",
       "\n",
       "                                         bs=7  \\\n",
       "0                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "1                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "2                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "3                        S(L0,L1,3,2)U(L2,16)   \n",
       "4                        S(L0,L1,3,2)U(L2,16)   \n",
       "5                        S(L0,L1,3,2)U(L2,16)   \n",
       "6   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "7   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "8   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "9                    S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "10                   S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "11                   S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "12       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "13       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "14       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "15                           I(L1,L2)U(L2,16)   \n",
       "16                           I(L1,L2)U(L2,16)   \n",
       "17                           I(L1,L2)U(L2,16)   \n",
       "18              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "19              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "20              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "21               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "22               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "23               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "24               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "25               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "26               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "27   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "28   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "29   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "30   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "31   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "32   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "33                               S(L0,L1,2,1)   \n",
       "34                               S(L0,L1,2,1)   \n",
       "35                               S(L0,L1,2,1)   \n",
       "36                               S(L0,L1,2,1)   \n",
       "37                               S(L0,L1,2,1)   \n",
       "38                               S(L0,L1,2,1)   \n",
       "39                                    U(L1,8)   \n",
       "40                                    U(L1,8)   \n",
       "41                                    U(L1,8)   \n",
       "42                               S(L0,L1,2,1)   \n",
       "43                               S(L0,L1,2,1)   \n",
       "44                               S(L0,L1,2,1)   \n",
       "45                               S(L0,L1,3,1)   \n",
       "46                               S(L0,L1,3,1)   \n",
       "47                               S(L0,L1,3,1)   \n",
       "48                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "49                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "50                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "51                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "52                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "53                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "54                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "55                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "56                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "57                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "58                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "59                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "60                       P(L0)T2(L0,L1,32,64)   \n",
       "61                       P(L0)T2(L0,L1,32,64)   \n",
       "62                       P(L0)T2(L0,L1,32,64)   \n",
       "63                                              \n",
       "64                                              \n",
       "65                                              \n",
       "66                            I(L0,L1)U(L1,8)   \n",
       "67                            I(L0,L1)U(L1,8)   \n",
       "68                            I(L0,L1)U(L1,8)   \n",
       "69                      P(L0)T2(L0,L1,64,128)   \n",
       "70                      P(L0)T2(L0,L1,64,128)   \n",
       "71                      P(L0)T2(L0,L1,64,128)   \n",
       "72                       P(L0)T2(L0,L1,32,64)   \n",
       "73                       P(L0)T2(L0,L1,32,64)   \n",
       "74                       P(L0)T2(L0,L1,32,64)   \n",
       "75                       I(L0,L1)P(L0)U(L2,8)   \n",
       "76                       I(L0,L1)P(L0)U(L2,8)   \n",
       "77                       I(L0,L1)P(L0)U(L2,8)   \n",
       "78                                   I(L0,L1)   \n",
       "79                                   I(L0,L1)   \n",
       "80                                   I(L0,L1)   \n",
       "81                            I(L1,L2)U(L2,8)   \n",
       "82                            I(L1,L2)U(L2,8)   \n",
       "83                            I(L1,L2)U(L2,8)   \n",
       "84                                      P(L0)   \n",
       "85                                      P(L0)   \n",
       "86                                      P(L0)   \n",
       "87                       I(L0,L1)P(L0)U(L2,8)   \n",
       "88                       I(L0,L1)P(L0)U(L2,8)   \n",
       "89                       I(L0,L1)P(L0)U(L2,8)   \n",
       "\n",
       "                                         bs=8  \\\n",
       "0                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "1                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "2                 S(L1,L2,2,1)T2(L1,L2,32,32)   \n",
       "3                         S(L0,L1,3,1)U(L2,8)   \n",
       "4                         S(L0,L1,3,1)U(L2,8)   \n",
       "5                         S(L0,L1,3,1)U(L2,8)   \n",
       "6   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "7   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "8   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)   \n",
       "9                    S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "10                   S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "11                   S(L0,L1,2,1)P(L1)U(L2,4)   \n",
       "12       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "13       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "14       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)   \n",
       "15                           I(L1,L2)U(L2,16)   \n",
       "16                           I(L1,L2)U(L2,16)   \n",
       "17                           I(L1,L2)U(L2,16)   \n",
       "18              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "19              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "20              I(L1,L2)P(L0)T2(L1,L2,64,128)   \n",
       "21               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "22               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "23               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "24               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "25               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "26               I(L1,L2)S(L0,L1,2,1)U(L2,16)   \n",
       "27   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "28   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "29   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "30   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "31   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "32   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)   \n",
       "33                               S(L0,L1,2,1)   \n",
       "34                               S(L0,L1,2,1)   \n",
       "35                               S(L0,L1,2,1)   \n",
       "36                               S(L0,L1,2,1)   \n",
       "37                               S(L0,L1,2,1)   \n",
       "38                               S(L0,L1,2,1)   \n",
       "39                                    U(L1,8)   \n",
       "40                                    U(L1,8)   \n",
       "41                                    U(L1,8)   \n",
       "42                               S(L0,L1,2,1)   \n",
       "43                               S(L0,L1,2,1)   \n",
       "44                               S(L0,L1,2,1)   \n",
       "45                               S(L0,L1,3,1)   \n",
       "46                               S(L0,L1,3,1)   \n",
       "47                               S(L0,L1,3,1)   \n",
       "48                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "49                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "50                  S(L0,L1,2,1)P(L1)U(L3,16)   \n",
       "51                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "52                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "53                I(L1,L2)S(L0,L1,3,1)U(L3,8)   \n",
       "54                   S(L0,L1,3,1)P(L1)U(L3,8)   \n",
       "55                   S(L0,L1,3,1)P(L1)U(L3,8)   \n",
       "56                   S(L0,L1,3,1)P(L1)U(L3,8)   \n",
       "57                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "58                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "59                   S(L0,L1,2,1)P(L1)U(L3,8)   \n",
       "60                       P(L0)T2(L0,L1,32,64)   \n",
       "61                       P(L0)T2(L0,L1,32,64)   \n",
       "62                       P(L0)T2(L0,L1,32,64)   \n",
       "63                                              \n",
       "64                                              \n",
       "65                                              \n",
       "66                            I(L0,L1)U(L1,8)   \n",
       "67                            I(L0,L1)U(L1,8)   \n",
       "68                            I(L0,L1)U(L1,8)   \n",
       "69                      P(L0)T2(L0,L1,64,128)   \n",
       "70                      P(L0)T2(L0,L1,64,128)   \n",
       "71                      P(L0)T2(L0,L1,64,128)   \n",
       "72                       P(L0)T2(L0,L1,32,64)   \n",
       "73                       P(L0)T2(L0,L1,32,64)   \n",
       "74                       P(L0)T2(L0,L1,32,64)   \n",
       "75                       I(L0,L1)P(L0)U(L2,8)   \n",
       "76                       I(L0,L1)P(L0)U(L2,8)   \n",
       "77                       I(L0,L1)P(L0)U(L2,8)   \n",
       "78                                   I(L0,L1)   \n",
       "79                                   I(L0,L1)   \n",
       "80                                   I(L0,L1)   \n",
       "81                            I(L1,L2)U(L2,8)   \n",
       "82                            I(L1,L2)U(L2,8)   \n",
       "83                            I(L1,L2)U(L2,8)   \n",
       "84                                      P(L0)   \n",
       "85                                      P(L0)   \n",
       "86                                      P(L0)   \n",
       "87                       I(L0,L1)P(L0)U(L2,8)   \n",
       "88                       I(L0,L1)P(L0)U(L2,8)   \n",
       "89                       I(L0,L1)P(L0)U(L2,8)   \n",
       "\n",
       "                                         bs=9  \n",
       "0                 S(L1,L2,2,1)T2(L1,L2,32,32)  \n",
       "1                 S(L1,L2,2,1)T2(L1,L2,32,32)  \n",
       "2                 S(L1,L2,2,1)T2(L1,L2,32,32)  \n",
       "3                         S(L0,L1,3,1)U(L2,8)  \n",
       "4                         S(L0,L1,3,1)U(L2,8)  \n",
       "5                         S(L0,L1,3,1)U(L2,8)  \n",
       "6   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)  \n",
       "7   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)  \n",
       "8   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,16)  \n",
       "9                    S(L0,L1,2,1)P(L1)U(L2,4)  \n",
       "10                   S(L0,L1,2,1)P(L1)U(L2,4)  \n",
       "11                   S(L0,L1,2,1)P(L1)U(L2,4)  \n",
       "12       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)  \n",
       "13       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)  \n",
       "14       I(L1,L2)P(L0)T2(L0,L1,32,32)U(L4,16)  \n",
       "15                           I(L1,L2)U(L2,16)  \n",
       "16                           I(L1,L2)U(L2,16)  \n",
       "17                           I(L1,L2)U(L2,16)  \n",
       "18              I(L1,L2)P(L0)T2(L1,L2,64,128)  \n",
       "19              I(L1,L2)P(L0)T2(L1,L2,64,128)  \n",
       "20              I(L1,L2)P(L0)T2(L1,L2,64,128)  \n",
       "21               I(L1,L2)S(L0,L1,2,1)U(L2,16)  \n",
       "22               I(L1,L2)S(L0,L1,2,1)U(L2,16)  \n",
       "23               I(L1,L2)S(L0,L1,2,1)U(L2,16)  \n",
       "24               I(L1,L2)S(L0,L1,2,1)U(L2,16)  \n",
       "25               I(L1,L2)S(L0,L1,2,1)U(L2,16)  \n",
       "26               I(L1,L2)S(L0,L1,2,1)U(L2,16)  \n",
       "27   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)  \n",
       "28   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)  \n",
       "29   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)  \n",
       "30   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)  \n",
       "31   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)  \n",
       "32   S(L0,L1,2,1)P(L1)T2(L0,L1,128,32)U(L4,8)  \n",
       "33                               S(L0,L1,2,1)  \n",
       "34                               S(L0,L1,2,1)  \n",
       "35                               S(L0,L1,2,1)  \n",
       "36                               S(L0,L1,2,1)  \n",
       "37                               S(L0,L1,2,1)  \n",
       "38                               S(L0,L1,2,1)  \n",
       "39                                    U(L1,8)  \n",
       "40                                    U(L1,8)  \n",
       "41                                    U(L1,8)  \n",
       "42                               S(L0,L1,2,1)  \n",
       "43                               S(L0,L1,2,1)  \n",
       "44                               S(L0,L1,2,1)  \n",
       "45                               S(L0,L1,3,1)  \n",
       "46                               S(L0,L1,3,1)  \n",
       "47                               S(L0,L1,3,1)  \n",
       "48                  S(L0,L1,2,1)P(L1)U(L3,16)  \n",
       "49                  S(L0,L1,2,1)P(L1)U(L3,16)  \n",
       "50                  S(L0,L1,2,1)P(L1)U(L3,16)  \n",
       "51                                    U(L3,4)  \n",
       "52                                    U(L3,4)  \n",
       "53                                    U(L3,4)  \n",
       "54                   S(L0,L1,3,1)P(L1)U(L3,8)  \n",
       "55                   S(L0,L1,3,1)P(L1)U(L3,8)  \n",
       "56                   S(L0,L1,3,1)P(L1)U(L3,8)  \n",
       "57                   S(L0,L1,2,1)P(L1)U(L3,8)  \n",
       "58                   S(L0,L1,2,1)P(L1)U(L3,8)  \n",
       "59                   S(L0,L1,2,1)P(L1)U(L3,8)  \n",
       "60                       P(L0)T2(L0,L1,32,64)  \n",
       "61                       P(L0)T2(L0,L1,32,64)  \n",
       "62                       P(L0)T2(L0,L1,32,64)  \n",
       "63                                             \n",
       "64                                             \n",
       "65                                             \n",
       "66                            I(L0,L1)U(L1,8)  \n",
       "67                            I(L0,L1)U(L1,8)  \n",
       "68                            I(L0,L1)U(L1,8)  \n",
       "69                      P(L0)T2(L0,L1,64,128)  \n",
       "70                      P(L0)T2(L0,L1,64,128)  \n",
       "71                      P(L0)T2(L0,L1,64,128)  \n",
       "72                       P(L0)T2(L0,L1,32,64)  \n",
       "73                       P(L0)T2(L0,L1,32,64)  \n",
       "74                       P(L0)T2(L0,L1,32,64)  \n",
       "75                       I(L0,L1)P(L0)U(L2,8)  \n",
       "76                       I(L0,L1)P(L0)U(L2,8)  \n",
       "77                       I(L0,L1)P(L0)U(L2,8)  \n",
       "78                                   I(L0,L1)  \n",
       "79                                   I(L0,L1)  \n",
       "80                                   I(L0,L1)  \n",
       "81                            I(L1,L2)U(L2,8)  \n",
       "82                            I(L1,L2)U(L2,8)  \n",
       "83                            I(L1,L2)U(L2,8)  \n",
       "84                                      P(L0)  \n",
       "85                                      P(L0)  \n",
       "86                                      P(L0)  \n",
       "87                       I(L0,L1)P(L0)U(L2,8)  \n",
       "88                       I(L0,L1)P(L0)U(L2,8)  \n",
       "89                       I(L0,L1)P(L0)U(L2,8)  "
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#return the results of beam search with its final schedules\n",
    "pd.set_option('display.max_rows',100)\n",
    "# df = simulate_BeamSearch_on_Dataset(bench_ds,bench_df, enforced_scheds_df, true_beam_search=False, get='schedules')\n",
    "df = simulate_BeamSearch_on_Dataset(bench_ds,bench_df, enforced_scheds_df, true_beam_search=False, get='schedules')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {
    "scrolled": true,
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8bc70bb64d684007bf7bd5329a71f198",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/30 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(93.48911488557209, 97.59062572154238, 104.25396825396825, 100.0, 100.0)"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "search_perf_df = get_search_performance(bench_ds,bench_df, enforced_scheds_df,true_beam_search=False, tira = False)\n",
    "search_perf = np.mean([min(100,i) for i in search_perf_df['bs=3']])\n",
    "np.mean(search_perf_df['bs=1']), np.mean(search_perf_df['bs=2']), np.mean(search_perf_df['bs=3']), np.mean(search_perf_df['bs=4']), search_perf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>nb_scheds</th>\n",
       "      <th>base_time</th>\n",
       "      <th>tira</th>\n",
       "      <th>bs=1</th>\n",
       "      <th>bs=2</th>\n",
       "      <th>bs=3</th>\n",
       "      <th>bs=4</th>\n",
       "      <th>bs=5</th>\n",
       "      <th>bs=6</th>\n",
       "      <th>bs=7</th>\n",
       "      <th>bs=8</th>\n",
       "      <th>bs=9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td>41</td>\n",
       "      <td>7.01036</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td>35</td>\n",
       "      <td>0.835829</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td>227</td>\n",
       "      <td>232.917999</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td>359</td>\n",
       "      <td>19681.5</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>762</td>\n",
       "      <td>0.946007</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>99</td>\n",
       "      <td>0.026936</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>3432</td>\n",
       "      <td>33.081902</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>function_matmul_LARGE</td>\n",
       "      <td>4692</td>\n",
       "      <td>16346.0</td>\n",
       "      <td>True</td>\n",
       "      <td>15.542591</td>\n",
       "      <td>38.212164</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>100</td>\n",
       "      <td>7.21077</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>70</td>\n",
       "      <td>1.24685</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>470</td>\n",
       "      <td>268.977997</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>734</td>\n",
       "      <td>17424.0</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>23.0481</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td>16</td>\n",
       "      <td>0.040832</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td>10</td>\n",
       "      <td>0.00403</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td>46</td>\n",
       "      <td>0.407311</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>5.72876</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>220</td>\n",
       "      <td>21.564301</td>\n",
       "      <td>True</td>\n",
       "      <td>113.888889</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>168</td>\n",
       "      <td>1.71655</td>\n",
       "      <td>True</td>\n",
       "      <td>99.285714</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>300</td>\n",
       "      <td>197.315994</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>1468</td>\n",
       "      <td>20338.800781</td>\n",
       "      <td>True</td>\n",
       "      <td>128.750982</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>20.381001</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>36</td>\n",
       "      <td>0.010014</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>21</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>78</td>\n",
       "      <td>0.096483</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>3.12811</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>17.4445</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>52</td>\n",
       "      <td>0.014422</td>\n",
       "      <td>True</td>\n",
       "      <td>85.950413</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>48</td>\n",
       "      <td>0.00276</td>\n",
       "      <td>True</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>227.619048</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>124</td>\n",
       "      <td>0.114715</td>\n",
       "      <td>True</td>\n",
       "      <td>52.083333</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>3.2137</td>\n",
       "      <td>True</td>\n",
       "      <td>221.498371</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        name nb_scheds     base_time  tira        bs=1  \\\n",
       "0    function_seidel2d_SMALL        41       7.01036  True  100.000000   \n",
       "1     function_seidel2d_MINI        35      0.835829  True  100.000000   \n",
       "2   function_seidel2d_MEDIUM       227    232.917999  True  100.000000   \n",
       "3    function_seidel2d_LARGE       359       19681.5  True  100.000000   \n",
       "4      function_matmul_SMALL       762      0.946007  True  100.000000   \n",
       "5       function_matmul_MINI        99      0.026936  True  100.000000   \n",
       "6     function_matmul_MEDIUM      3432     33.081902  True  100.000000   \n",
       "7      function_matmul_LARGE      4692       16346.0  True   15.542591   \n",
       "8    function_jacobi2d_SMALL       100       7.21077  True  100.000000   \n",
       "9     function_jacobi2d_MINI        70       1.24685  True  100.000000   \n",
       "10  function_jacobi2d_MEDIUM       470    268.977997  True  100.000000   \n",
       "11   function_jacobi2d_LARGE       734       17424.0  True  100.000000   \n",
       "12  function_jacobi1d_XLARGE        64       23.0481  True  100.000000   \n",
       "13   function_jacobi1d_SMALL        16      0.040832  True  100.000000   \n",
       "14    function_jacobi1d_MINI        10       0.00403  True  100.000000   \n",
       "15  function_jacobi1d_MEDIUM        46      0.407311  True  100.000000   \n",
       "16   function_jacobi1d_LARGE        64       5.72876  True  100.000000   \n",
       "17     function_heat3d_SMALL       220     21.564301  True  113.888889   \n",
       "18      function_heat3d_MINI       168       1.71655  True   99.285714   \n",
       "19    function_heat3d_MEDIUM       300    197.315994  True  100.000000   \n",
       "20     function_heat3d_LARGE      1468  20338.800781  True  128.750982   \n",
       "21    function_heat2d_XLARGE        78     20.381001  True  100.000000   \n",
       "22     function_heat2d_SMALL        36      0.010014  True  100.000000   \n",
       "23      function_heat2d_MINI        21      0.001186  True  100.000000   \n",
       "24    function_heat2d_MEDIUM        78      0.096483  True  100.000000   \n",
       "25     function_heat2d_LARGE        78       3.12811  True  100.000000   \n",
       "26      function_blur_XLARGE       160       17.4445  True  100.000000   \n",
       "27       function_blur_SMALL        52      0.014422  True   85.950413   \n",
       "28        function_blur_MINI        48       0.00276  True  100.000000   \n",
       "29      function_blur_MEDIUM       124      0.114715  True   52.083333   \n",
       "30       function_blur_LARGE       160        3.2137  True  221.498371   \n",
       "\n",
       "          bs=2        bs=3   bs=4   bs=5   bs=6   bs=7   bs=8   bs=9  \n",
       "0   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "1   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "2   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "3   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "4   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "5   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "6   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "7    38.212164  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "8   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "9   100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "10  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "11  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "12  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "13  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "14  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "15  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "16  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "17  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "18  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "19  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "20  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "21  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "22  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "23  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "24  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "25  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "26  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "27  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "28  100.000000  227.619048  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "29  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "30  100.000000  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  "
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "search_perf_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {
    "scrolled": true,
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3864e34b973a4c84ba3d55f311a76b88",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/31 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(100.0, 104.11674347158218, 100.0, 100.0)"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "search_perf_df = get_search_performance(bench_ds,bench_df, enforced_scheds_df,true_beam_search=False, tira = False)\n",
    "search_perf = np.mean([min(100,i) for i in search_perf_df['bs=3']])\n",
    "np.mean(search_perf_df['bs=2']) , np.mean(search_perf_df['bs=3']), np.mean(search_perf_df['bs=4']), search_perf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>nb_scheds</th>\n",
       "      <th>base_time</th>\n",
       "      <th>tira</th>\n",
       "      <th>bs=1</th>\n",
       "      <th>bs=2</th>\n",
       "      <th>bs=3</th>\n",
       "      <th>bs=4</th>\n",
       "      <th>bs=5</th>\n",
       "      <th>bs=6</th>\n",
       "      <th>bs=7</th>\n",
       "      <th>bs=8</th>\n",
       "      <th>bs=9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>function_seidel2d_SMALL</td>\n",
       "      <td>41</td>\n",
       "      <td>7.01036</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>function_seidel2d_MINI</td>\n",
       "      <td>35</td>\n",
       "      <td>0.835829</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>function_seidel2d_MEDIUM</td>\n",
       "      <td>227</td>\n",
       "      <td>232.917999</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>function_seidel2d_LARGE</td>\n",
       "      <td>359</td>\n",
       "      <td>19681.5</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>function_matmul_SMALL</td>\n",
       "      <td>762</td>\n",
       "      <td>0.946007</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>function_matmul_MINI</td>\n",
       "      <td>99</td>\n",
       "      <td>0.026936</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>function_matmul_MEDIUM</td>\n",
       "      <td>3432</td>\n",
       "      <td>33.081902</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>function_matmul_LARGE</td>\n",
       "      <td>4692</td>\n",
       "      <td>16346.0</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>function_jacobi2d_SMALL</td>\n",
       "      <td>100</td>\n",
       "      <td>7.21077</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>function_jacobi2d_MINI</td>\n",
       "      <td>70</td>\n",
       "      <td>1.24685</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>function_jacobi2d_MEDIUM</td>\n",
       "      <td>470</td>\n",
       "      <td>268.977997</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>function_jacobi2d_LARGE</td>\n",
       "      <td>734</td>\n",
       "      <td>17424.0</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>function_jacobi1d_XLARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>23.0481</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>function_jacobi1d_SMALL</td>\n",
       "      <td>16</td>\n",
       "      <td>0.040832</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>function_jacobi1d_MINI</td>\n",
       "      <td>10</td>\n",
       "      <td>0.00403</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>function_jacobi1d_MEDIUM</td>\n",
       "      <td>46</td>\n",
       "      <td>0.407311</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>function_jacobi1d_LARGE</td>\n",
       "      <td>64</td>\n",
       "      <td>5.72876</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>function_heat3d_SMALL</td>\n",
       "      <td>220</td>\n",
       "      <td>21.564301</td>\n",
       "      <td>False</td>\n",
       "      <td>113.888889</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>function_heat3d_MINI</td>\n",
       "      <td>168</td>\n",
       "      <td>1.71655</td>\n",
       "      <td>False</td>\n",
       "      <td>99.285714</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>function_heat3d_MEDIUM</td>\n",
       "      <td>300</td>\n",
       "      <td>197.315994</td>\n",
       "      <td>False</td>\n",
       "      <td>98.400000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>function_heat3d_LARGE</td>\n",
       "      <td>1468</td>\n",
       "      <td>20338.800781</td>\n",
       "      <td>False</td>\n",
       "      <td>128.750982</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>function_heat2d_XLARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>20.381001</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>function_heat2d_SMALL</td>\n",
       "      <td>36</td>\n",
       "      <td>0.010014</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>function_heat2d_MINI</td>\n",
       "      <td>21</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>function_heat2d_MEDIUM</td>\n",
       "      <td>78</td>\n",
       "      <td>0.096483</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>function_heat2d_LARGE</td>\n",
       "      <td>78</td>\n",
       "      <td>3.12811</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>function_blur_XLARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>17.4445</td>\n",
       "      <td>False</td>\n",
       "      <td>117.829457</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>function_blur_SMALL</td>\n",
       "      <td>52</td>\n",
       "      <td>0.014422</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>function_blur_MINI</td>\n",
       "      <td>48</td>\n",
       "      <td>0.00276</td>\n",
       "      <td>False</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>227.619048</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>function_blur_MEDIUM</td>\n",
       "      <td>124</td>\n",
       "      <td>0.114715</td>\n",
       "      <td>False</td>\n",
       "      <td>52.083333</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>function_blur_LARGE</td>\n",
       "      <td>160</td>\n",
       "      <td>3.2137</td>\n",
       "      <td>False</td>\n",
       "      <td>221.498371</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.000000</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        name nb_scheds     base_time   tira        bs=1  \\\n",
       "0    function_seidel2d_SMALL        41       7.01036  False  100.000000   \n",
       "1     function_seidel2d_MINI        35      0.835829  False  100.000000   \n",
       "2   function_seidel2d_MEDIUM       227    232.917999  False  100.000000   \n",
       "3    function_seidel2d_LARGE       359       19681.5  False  100.000000   \n",
       "4      function_matmul_SMALL       762      0.946007  False  100.000000   \n",
       "5       function_matmul_MINI        99      0.026936  False  100.000000   \n",
       "6     function_matmul_MEDIUM      3432     33.081902  False  100.000000   \n",
       "7      function_matmul_LARGE      4692       16346.0  False  100.000000   \n",
       "8    function_jacobi2d_SMALL       100       7.21077  False  100.000000   \n",
       "9     function_jacobi2d_MINI        70       1.24685  False  100.000000   \n",
       "10  function_jacobi2d_MEDIUM       470    268.977997  False  100.000000   \n",
       "11   function_jacobi2d_LARGE       734       17424.0  False  100.000000   \n",
       "12  function_jacobi1d_XLARGE        64       23.0481  False  100.000000   \n",
       "13   function_jacobi1d_SMALL        16      0.040832  False  100.000000   \n",
       "14    function_jacobi1d_MINI        10       0.00403  False  100.000000   \n",
       "15  function_jacobi1d_MEDIUM        46      0.407311  False  100.000000   \n",
       "16   function_jacobi1d_LARGE        64       5.72876  False  100.000000   \n",
       "17     function_heat3d_SMALL       220     21.564301  False  113.888889   \n",
       "18      function_heat3d_MINI       168       1.71655  False   99.285714   \n",
       "19    function_heat3d_MEDIUM       300    197.315994  False   98.400000   \n",
       "20     function_heat3d_LARGE      1468  20338.800781  False  128.750982   \n",
       "21    function_heat2d_XLARGE        78     20.381001  False  100.000000   \n",
       "22     function_heat2d_SMALL        36      0.010014  False  100.000000   \n",
       "23      function_heat2d_MINI        21      0.001186  False  100.000000   \n",
       "24    function_heat2d_MEDIUM        78      0.096483  False  100.000000   \n",
       "25     function_heat2d_LARGE        78       3.12811  False  100.000000   \n",
       "26      function_blur_XLARGE       160       17.4445  False  117.829457   \n",
       "27       function_blur_SMALL        52      0.014422  False  100.000000   \n",
       "28        function_blur_MINI        48       0.00276  False  100.000000   \n",
       "29      function_blur_MEDIUM       124      0.114715  False   52.083333   \n",
       "30       function_blur_LARGE       160        3.2137  False  221.498371   \n",
       "\n",
       "     bs=2        bs=3   bs=4   bs=5   bs=6   bs=7   bs=8   bs=9  \n",
       "0   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "1   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "2   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "3   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "4   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "5   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "6   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "7   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "8   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "9   100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "10  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "11  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "12  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "13  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "14  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "15  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "16  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "17  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "18  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "19  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "20  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "21  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "22  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "23  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "24  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "25  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "26  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "27  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "28  100.0  227.619048  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "29  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  \n",
       "30  100.0  100.000000  100.0  100.0  100.0  100.0  100.0  100.0  "
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "search_perf_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Utils\n",
    "<a id='utils'></a>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import ujson as json\n",
    "from tqdm.notebook import tqdm\n",
    "import re\n",
    "import torch\n",
    "import numpy as np\n",
    "import random \n",
    "import torch.nn as nn\n",
    "import pandas as pd\n",
    "from torch import optim\n",
    "import time\n",
    "import sys\n",
    "import pickle\n",
    "try:\n",
    "    from torch.optim import AdamW\n",
    "    from torch.optim.lr_scheduler import OneCycleLR\n",
    "except:\n",
    "    sys.path.append(\"../_new_repr_to_reorder/2_Model_training_tests/CostModels/\")\n",
    "    from src.torch141.lr_scheduler import *\n",
    "    from src.torch141.adamw import *\n",
    "from IPython.display import clear_output\n",
    "from matplotlib import pyplot as plt\n",
    "import copy\n",
    "import math\n",
    "from scipy.stats import spearmanr\n",
    "from sklearn.metrics import ndcg_score\n",
    "\n",
    "\n",
    "store_device = torch.device(store_device_name)\n",
    "train_device = torch.device(train_device_name)\n",
    "\n",
    "\n",
    "\n",
    "class NbAccessException(Exception):\n",
    "    pass\n",
    "class LoopsDepthException(Exception):\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Functions for dataloading"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [],
   "source": [
    "#for cost model\n",
    "def speedup_clip(speedup):\n",
    "    if speedup<0.01:\n",
    "        speedup = 0.01\n",
    "    return speedup\n",
    "\n",
    "def drop_program(prog_dict):   \n",
    "    if len(prog_dict['schedules_list'])<2:\n",
    "        return True\n",
    "    if has_skippable_loop_1comp(prog_dict):\n",
    "        return True\n",
    "    if 'node_name' in prog_dict and prog_dict['node_name']=='lanka24': # drop if we the program is run by lanka24 (because its measurements are inacurate)\n",
    "        return True\n",
    "    return False   \n",
    "\n",
    "def drop_schedule(prog_dict, schedule_index):\n",
    "    schedule_json =  prog_dict['schedules_list'][schedule_index]\n",
    "    schedule_str = sched_json_to_sched_str(schedule_json)\n",
    "    program_depth = len(prog_dict['program_annotation']['iterators'])\n",
    "    if (not schedule_json['execution_times']) or min(schedule_json['execution_times'])<0: # exec time is set to -1 on datapoints that are deemed noisy, or if list empty\n",
    "        return True\n",
    "    if len(prog_dict['program_annotation']['computations'])==1: #this function works only on single comp programs\n",
    "        if sched_is_prunable_1comp(schedule_str,program_depth):\n",
    "            return True \n",
    "    \n",
    "    if len(schedule_json['execution_times'])==1:\n",
    "        total_def_eval+=1\n",
    "        if 'function760518'<prog_dict['filename'][2:16]<'function761289': \n",
    "            def_eval_in_range+=1\n",
    "        if total_def_eval%10==0:\n",
    "            print(total_def_eval,def_eval_in_range)\n",
    "        return True\n",
    "    if wrongly_pruned_schedule(prog_dict, schedule_index):\n",
    "        return True\n",
    "\n",
    "    return False\n",
    "\n",
    "def default_eval(prog_dict, schedule_index):\n",
    "    schedule_json =  prog_dict['schedules_list'][schedule_index]\n",
    "    schedule_str = sched_json_to_sched_str(schedule_json)\n",
    "    program_depth = len(prog_dict['program_annotation']['iterators'])\n",
    "    if len(prog_dict['program_annotation']['computations'])==1: #this function works only on single comp programs\n",
    "        return can_set_default_eval_1comp(schedule_str,program_depth)\n",
    "    else:\n",
    "        return 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": [
    "#for LI\n",
    "def filter_schedule_MC(schedule_str): # needs to return True if we want the passed schedule to be dropped \n",
    "    \n",
    "    regex1 = \"^I\\(\\{[C0-9,]+\\},L[0-9]+,L[0-9]+\\)$\"\n",
    "    regex2 = \"F\\(\\{[C0-9,]+\\},L[0-9]+\\)I\\(\\{[C0-9,]+\\},L[0-9]+,L[0-9]+\\)$\"\n",
    "    if re.search(regex1, schedule_str) or re.search(regex2, schedule_str) : # drops all the schedules except the loop interchanges\n",
    "        return True\n",
    "    if schedule_str==\"\":\n",
    "        return True\n",
    "    return False\n",
    "\n",
    "def filter_schedule_SC(schedule_str): # needs to return True if we want the passed schedule to be dropped \n",
    "    \n",
    "    regex = \"I\\(L[0-9]+,L[0-9]+\\)$\"\n",
    "    #regex = \"^I\\(\\{[C0-9,]+\\},L[0-9]+,L[0-9]+\\)$\"\n",
    "    if re.search(regex, schedule_str): # drops all the schedules except the loop interchanges\n",
    "        return True\n",
    "    if schedule_str==\"\":\n",
    "        return True\n",
    "    return False"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Functions for Beam Search simulation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def update_exploration_trace(node, func_predictions_df, func_enforced_df):\n",
    "    if not node['schedule'] in list(func_predictions_df['sched_str']):\n",
    "        print(node['schedule'])\n",
    "        return None\n",
    "    sched = node['schedule']\n",
    "    depth = node['depth']\n",
    "    level_enforcement = func_enforced_df.query('depth==@depth') # it returns all the enforced nodes in the level\n",
    "\n",
    "    if not level_enforcement.empty: #there is at least one enforced node in the level.\n",
    "        node['level_has_enforcement'] = True\n",
    "        res = level_enforcement.query('sched_str==@sched') \n",
    "        if not res.empty:\n",
    "            node['enforced'] = True\n",
    "            node['priority']= res.iloc[0]['priority']\n",
    "        else:\n",
    "            node['enforced'] = False\n",
    "            node['priority']= 5 #because k = 5\n",
    "        \n",
    "    else:\n",
    "        node['level_has_enforcement'] = False\n",
    "        \n",
    "    \n",
    "#     node['id'] = int(func_predictions_df.query('sched_str == @sched')['sched_name'])\n",
    "    new_children = []\n",
    "    for child in node['children']:\n",
    "        updated = update_exploration_trace(child, func_predictions_df, func_enforced_df)\n",
    "        if updated != None:\n",
    "            new_children.append(updated)\n",
    "    node['children'] = new_children\n",
    "    return node\n",
    "  \n",
    "def simulate_BeamSearch(root,beam_size,preds_dict=None,eval_mode='execution'): # given an exploration trace and a beam size, return the best candidate that can be found using that beam size\n",
    "    children = root['children']\n",
    "    if len(children)==0:\n",
    "        return root\n",
    "    \n",
    "    if eval_mode != 'execution':\n",
    "        if (children[0]['level_has_enforcement']): #that s our target level.\n",
    "            if eval_mode == 'model':\n",
    "                for child in children:\n",
    "                    child['prediction'] = preds_dict[child['schedule']] #new column\n",
    "                children = sorted(children, key = lambda x: x['prediction'], reverse=True) #was reverse = \\true // maybe because it is an exec time\n",
    "                children = children[:beam_size]\n",
    "            else: #if level1\n",
    "                assert children[0]['level_has_enforcement'] == True # if some enforcement is set at this level = special model\n",
    "                children = sorted(children, key = lambda x: x['priority']) #take all the children, from small priority to highest one.\n",
    "                children = children[:beam_size]\n",
    "#                 print(children[0]['schedule'])\n",
    "            root['prediction'] = preds_dict[root['schedule']] #do we need this ?\n",
    "        else:\n",
    "            children = sorted(children, key = lambda x: x['evaluation']) \n",
    "            children = children[:beam_size] \n",
    "#             print(children[0]['schedule'])\n",
    "    else:\n",
    "        children = sorted(children, key = lambda x: x['evaluation']) \n",
    "        children = children[:beam_size]  \n",
    "#     print('----------------------------------------')\n",
    "    bests = []\n",
    "    for child in children:\n",
    "        bests.append(simulate_BeamSearch(child,beam_size,preds_dict,eval_mode))\n",
    "    bests.append(root) \n",
    "#     if eval_mode == 'model':\n",
    "#         return max(bests, key = lambda x: x['prediction'])\n",
    "#     elif eval_mode == 'execution':\n",
    "#         return min(bests, key = lambda x: x['evaluation'])\n",
    "    return min(bests, key = lambda x: x['evaluation'])\n",
    "    \n",
    "def simulate_TrueBeamSearch(root,beam_size,preds_dict=None,eval_mode='execution'): # given an exploration trace and a beam size, return the best candidate that can be found using that beam size\n",
    "    if eval_mode == 'model':\n",
    "        root['prediction'] = preds_dict[root['schedule']]\n",
    "    candidates = [root]\n",
    "    bests = [root]\n",
    "    while len(candidates)!=0:\n",
    "        new_candidates = []\n",
    "        for candidate in candidates:\n",
    "            new_candidates.extend(candidate['children'])\n",
    "        if len(new_candidates)>0:    \n",
    "            if eval_mode == 'model':\n",
    "                for new_candidate in new_candidates: # sort candidates in both cases (with and without enforcement)\n",
    "                    new_candidate['prediction'] = preds_dict[new_candidate['schedule']]\n",
    "                new_candidates = sorted(new_candidates, key = lambda x: x['prediction'],reverse=True)\n",
    "                if new_candidates[0]['level_has_enforcement']: # if some enforcement is set at this level \n",
    "                    candidates= [candidate for candidate in new_candidates if candidate['enforced']] # take the enforced childs only\n",
    "                else: # if no enforcement, take BS best\n",
    "                    candidates = new_candidates[:beam_size]\n",
    "            elif eval_mode == 'execution':\n",
    "                new_candidates = sorted(new_candidates, key = lambda x: x['evaluation'])\n",
    "                candidates = new_candidates[:beam_size]\n",
    "\n",
    "            bests.append(new_candidates[0])\n",
    "        else:\n",
    "            candidates= new_candidates #empty list\n",
    "        \n",
    "    if eval_mode == 'model':\n",
    "        return max(bests, key = lambda x: x['prediction'])\n",
    "    \n",
    "    elif eval_mode == 'execution':\n",
    "        return min(bests, key = lambda x: x['evaluation'])\n",
    "        \n",
    "\n",
    "def simulate_BeamSearch_on_Dataset(dataset, predictions_df, enforced_scheds_df,true_beam_search=False, get='speedups'):\n",
    "    # I added the ground truth ^^\n",
    "    if true_beam_search:\n",
    "        bs_func = simulate_TrueBeamSearch\n",
    "    else:\n",
    "        bs_func = simulate_BeamSearch\n",
    "    assert get in ['speedups', 'schedules']\n",
    "        \n",
    "    df = pd.DataFrame(columns = ['name','nb_scheds','base_time', 'eval_mode']+['bs='+str(i) for i in range(1,10)])\n",
    "    for func_name in tqdm(sorted(list(predictions_df['name'].unique()),reverse=True)):\n",
    "        \n",
    "        func_dict = dataset.programs_dict[func_name]\n",
    "\n",
    "        nb_scheds = len(func_dict['schedules_list'])\n",
    "        init_exec_time = func_dict['initial_execution_time']\n",
    "        root = update_exploration_trace(func_dict['exploration_trace'], predictions_df.query('name==@func_name'), enforced_scheds_df.query('name==@func_name'))\n",
    "        root['depth'] = 0\n",
    "#         best_candidate = simulate_BeamSearch(root,9999999,eval_mode='execution')\n",
    "#         best_sp = round(root['evaluation']/best_candidate['evaluation'],2)\n",
    "#         best_sched = best_candidate['schedule']\n",
    "        sp_per_bs = dict()\n",
    "        predictions_dict = predictions_df.query('name==@func_name')[['sched_str','prediction']].set_index('sched_str').to_dict()['prediction']    \n",
    "#         print(func_name)\n",
    "        for eval_mode in ['execution','model', 'level1']:\n",
    "            sp_per_bs[eval_mode]=[]\n",
    "            for i in range(1,10): #10 = max beam size\n",
    "                if get=='schedules':\n",
    "                    sp_per_bs[eval_mode].append(bs_func(root,i,preds_dict=predictions_dict,eval_mode=eval_mode)['schedule'])\n",
    "                else:\n",
    "                    sp_per_bs[eval_mode].append(round(root['evaluation']/bs_func(root,i,preds_dict=predictions_dict,eval_mode=eval_mode)['evaluation'],2)) ###  why is it evaluation ??\n",
    "\n",
    "        df.loc[len(df)] = [func_name, str(nb_scheds), str(init_exec_time), 'execution'] + [i for i in sp_per_bs['execution']]\n",
    "        df.loc[len(df)] = [func_name, str(nb_scheds), str(init_exec_time), 'model'] + [i for i in sp_per_bs['model']]\n",
    "        df.loc[len(df)] = [func_name, str(nb_scheds), str(init_exec_time), 'level1'] + [i for i in sp_per_bs['level1']]\n",
    "    return df\n",
    "\n",
    "def get_search_performance(dataset, predictions_df, enforced_scheds_df, true_beam_search=False, tira=True):\n",
    "    if true_beam_search:\n",
    "        bs_func = simulate_TrueBeamSearch\n",
    "    else:\n",
    "        bs_func = simulate_BeamSearch\n",
    "        \n",
    "    df = pd.DataFrame(columns = ['name','nb_scheds','base_time','tira']+['bs='+str(i) for i in range(1,10)])\n",
    "    for func_name in tqdm(sorted(list(predictions_df['name'].unique()),reverse=True)):\n",
    "        \n",
    "        func_dict = dataset.programs_dict[func_name]\n",
    "\n",
    "        nb_scheds = len(func_dict['schedules_list'])\n",
    "        init_exec_time = func_dict['initial_execution_time']\n",
    "        root = update_exploration_trace(func_dict['exploration_trace'], predictions_df.query('name==@func_name'), enforced_scheds_df.query('name==@func_name'))\n",
    "        root['depth'] = 0\n",
    "#         best_candidate = simulate_BeamSearch(root,9999999,eval_mode='execution')\n",
    "#         best_sp = round(root['evaluation']/best_candidate['evaluation'],2)\n",
    "#         best_sched = best_candidate['schedule']\n",
    "        sp_per_bs = dict()\n",
    "        predictions_dict = predictions_df.query('name==@func_name')[['sched_str','prediction']].set_index('sched_str').to_dict()['prediction']    \n",
    "        for eval_mode in ['execution','model', 'level1']:\n",
    "            sp_per_bs[eval_mode]=[]\n",
    "            for i in range(1,10):\n",
    "                sp_per_bs[eval_mode].append((round(root['evaluation']/bs_func(root,i,preds_dict=predictions_dict,eval_mode=eval_mode)['evaluation'],2)))\n",
    "                \n",
    "#         only difference with function with schedules\n",
    "        if tira==True:\n",
    "            df.loc[len(df)] = [func_name, str(nb_scheds), str(init_exec_time), 'True'] + [sp_per_bs['model'][i]/sp_per_bs['execution'][i]*100 for i in range(len(sp_per_bs['execution']))]\n",
    "        else:\n",
    "            df.loc[len(df)] = [func_name, str(nb_scheds), str(init_exec_time), 'False'] + [sp_per_bs['level1'][i]/sp_per_bs['execution'][i]*100 for i in range(len(sp_per_bs['execution']))]\n",
    "    return df\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Functions for Cost model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "#!/usr/bin/env python\n",
    "# coding: utf-8\n",
    "\n",
    "# In[1]:\n",
    "\n",
    "\n",
    "from os import environ\n",
    "from pprint import pprint\n",
    "import pickle\n",
    "import numpy as np\n",
    "import torch \n",
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "from torch import optim\n",
    "import time\n",
    "from tqdm.notebook import tqdm\n",
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "import math\n",
    "import copy\n",
    "import random\n",
    "import plotly.graph_objects as go\n",
    "import sys\n",
    "import re\n",
    "from torch.optim import AdamW\n",
    "from torch.optim.lr_scheduler import OneCycleLR\n",
    "import json\n",
    "\n",
    "# class NbAccessException(Exception):\n",
    "#     pass\n",
    "# class LoopsDepthException(Exception):\n",
    "#     pass\n",
    "\n",
    "# train_device= torch.device(environ.get('train_device'))\n",
    "# store_device= torch.device(environ.get('store_device'))\n",
    "\n",
    "# In[2]:\n",
    "\n",
    "\n",
    "def mape_criterion(inputs, targets):\n",
    "    eps = 1e-5\n",
    "    return 100*torch.mean(torch.abs(targets - inputs)/(targets+eps))\n",
    "def get_tree_footprint(tree):\n",
    "    footprint='<L'+str(int(tree['loop_index']))+'>'\n",
    "    if tree['has_comps']:\n",
    "        footprint+='['\n",
    "        for idx in tree['computations_indices']:\n",
    "            footprint+='C'+str(int(idx))\n",
    "        footprint+=']'\n",
    "    for child in tree['child_list']:\n",
    "        footprint+= get_tree_footprint(child)\n",
    "    footprint+='</L'+str(int(tree['loop_index']))+'>'\n",
    "    return footprint\n",
    "class Model_Recursive_LSTM_v2(nn.Module):\n",
    "    def __init__(self, input_size, comp_embed_layer_sizes=[600, 350, 200, 180], drops=[0.225, 0.225, 0.225, 0.225], output_size=1):\n",
    "        super().__init__()\n",
    "        embedding_size = comp_embed_layer_sizes[-1]\n",
    "        regression_layer_sizes = [embedding_size] + comp_embed_layer_sizes[-2:]\n",
    "        concat_layer_sizes = [embedding_size*2+20] + comp_embed_layer_sizes[-2:]\n",
    "        comp_embed_layer_sizes = [input_size] + comp_embed_layer_sizes\n",
    "        self.comp_embedding_layers = nn.ModuleList()\n",
    "        self.comp_embedding_dropouts= nn.ModuleList()\n",
    "        self.regression_layers = nn.ModuleList()\n",
    "        self.regression_dropouts= nn.ModuleList()\n",
    "        self.concat_layers = nn.ModuleList()\n",
    "        self.concat_dropouts= nn.ModuleList()\n",
    "        for i in range(len(comp_embed_layer_sizes)-1):\n",
    "            self.comp_embedding_layers.append(nn.Linear(comp_embed_layer_sizes[i], comp_embed_layer_sizes[i+1], bias=True))\n",
    "#             nn.init.xavier_uniform_(self.comp_embedding_layers[i].weight)\n",
    "            nn.init.zeros_(self.comp_embedding_layers[i].weight)\n",
    "            self.comp_embedding_dropouts.append(nn.Dropout(drops[i]))\n",
    "        for i in range(len(regression_layer_sizes)-1):\n",
    "            self.regression_layers.append(nn.Linear(regression_layer_sizes[i], regression_layer_sizes[i+1], bias=True))\n",
    "#             nn.init.xavier_uniform_(self.regression_layers[i].weight)\n",
    "            nn.init.zeros_(self.regression_layers[i].weight)\n",
    "            self.regression_dropouts.append(nn.Dropout(drops[i]))\n",
    "        for i in range(len(concat_layer_sizes)-1):\n",
    "            self.concat_layers.append(nn.Linear(concat_layer_sizes[i], concat_layer_sizes[i+1], bias=True))\n",
    "#             nn.init.xavier_uniform_(self.concat_layers[i].weight)\n",
    "            nn.init.zeros_(self.concat_layers[i].weight)\n",
    "            self.concat_dropouts.append(nn.Dropout(drops[i]))\n",
    "        self.predict = nn.Linear(regression_layer_sizes[-1], output_size, bias=True)\n",
    "#         nn.init.xavier_uniform_(self.predict.weight)\n",
    "        nn.init.zeros_(self.predict.weight)\n",
    "        self.ELU=nn.ELU()\n",
    "        self.no_comps_tensor = nn.Parameter(nn.init.xavier_uniform_(torch.zeros(1, embedding_size)))\n",
    "        self.no_nodes_tensor = nn.Parameter(nn.init.xavier_uniform_(torch.zeros(1, embedding_size)))\n",
    "        self.comps_lstm = nn.LSTM(comp_embed_layer_sizes[-1], embedding_size, batch_first=True)\n",
    "        self.nodes_lstm = nn.LSTM(comp_embed_layer_sizes[-1], embedding_size, batch_first=True)\n",
    "        \n",
    "    def get_hidden_state(self, node, comps_embeddings, loops_tensor):\n",
    "        nodes_list = []\n",
    "        for n in node['child_list']:\n",
    "            nodes_list.append(self.get_hidden_state(n, comps_embeddings,loops_tensor))\n",
    "        if (nodes_list != []):\n",
    "            nodes_tensor = torch.cat(nodes_list, 1) \n",
    "            lstm_out, (nodes_h_n, nodes_c_n) = self.nodes_lstm(nodes_tensor)\n",
    "            nodes_h_n = nodes_h_n.permute(1,0,2)\n",
    "        else:       \n",
    "            nodes_h_n = torch.unsqueeze(self.no_nodes_tensor, 0).expand(comps_embeddings.shape[0], -1, -1)\n",
    "        if (node['has_comps']):\n",
    "            selected_comps_tensor = torch.index_select(comps_embeddings, 1, node['computations_indices'])\n",
    "            lstm_out, (comps_h_n, comps_c_n) = self.comps_lstm(selected_comps_tensor) \n",
    "            comps_h_n = comps_h_n.permute(1,0,2)\n",
    "        else:\n",
    "            comps_h_n = torch.unsqueeze(self.no_comps_tensor, 0).expand(comps_embeddings.shape[0], -1, -1)\n",
    "        selected_loop_tensor = torch.index_select(loops_tensor,1,node['loop_index'])\n",
    "        x = torch.cat((nodes_h_n, comps_h_n, selected_loop_tensor),2)\n",
    "        for i in range(len(self.concat_layers)):\n",
    "            x = self.concat_layers[i](x)\n",
    "            x = self.concat_dropouts[i](self.ELU(x))\n",
    "        return x  \n",
    "\n",
    "    def forward(self, tree_tensors):\n",
    "        tree, comps_tensor, loops_tensor = tree_tensors\n",
    "        #computation embbedding layer\n",
    "        x = comps_tensor\n",
    "        for i in range(len(self.comp_embedding_layers)):\n",
    "            x = self.comp_embedding_layers[i](x)\n",
    "            x = self.comp_embedding_dropouts[i](self.ELU(x))  \n",
    "        comps_embeddings = x\n",
    "        #recursive loop embbeding layer\n",
    "        prog_embedding = self.get_hidden_state(tree, comps_embeddings, loops_tensor)\n",
    "        #regression layer\n",
    "        x = prog_embedding\n",
    "        for i in range(len(self.regression_layers)):\n",
    "            x = self.regression_layers[i](x)\n",
    "            x = self.regression_dropouts[i](self.ELU(x))\n",
    "        out = self.predict(x)\n",
    "            \n",
    "        return self.ELU(out[:,0,0])\n",
    "\n",
    "\n",
    "# In[3]:\n",
    "\n",
    "\n",
    "def load_data(train_val_dataset_file, split_ratio=None, max_batch_size=2048, drop_sched_func=None, drop_prog_func=None, default_eval=None, speedups_clip_func=None):\n",
    "    print(\"loading batches from: \"+train_val_dataset_file)\n",
    "    dataset = Dataset(train_val_dataset_file, max_batch_size, drop_sched_func, drop_prog_func, default_eval, speedups_clip_func)\n",
    "    if split_ratio == None:\n",
    "        split_ratio=0.2\n",
    "    if split_ratio > 1 : # not a ratio a number of batches\n",
    "        validation_size = split_ratio\n",
    "    else:\n",
    "        validation_size = int(split_ratio * len(dataset))\n",
    "    indices = list(range(len(dataset)))\n",
    "#     random.Random(42).shuffle(indices)\n",
    "    val_batches_indices, train_batches_indices = indices[:validation_size],                                               indices[validation_size:]\n",
    "    val_batches_list=[]\n",
    "    train_batches_list=[]\n",
    "    for i in val_batches_indices:\n",
    "        val_batches_list.append(dataset[i])\n",
    "    for i in train_batches_indices:\n",
    "        train_batches_list.append(dataset[i])\n",
    "    print(\"Data loaded\")\n",
    "    print(\"Sizes: \"+str((len(val_batches_list),len(train_batches_list)))+\" batches\")\n",
    "    return dataset, val_batches_list, val_batches_indices, train_batches_list, train_batches_indices\n",
    "\n",
    "\n",
    "def get_representation_template(program_dict, max_depth):\n",
    "    max_accesses = 15\n",
    "    min_accesses = 1\n",
    "#     max_depth = 5 \n",
    "    \n",
    "    comps_repr_templates_list = []\n",
    "    comps_indices_dict = dict()\n",
    "    comps_placeholders_indices_dict = dict()\n",
    "    \n",
    "    program_json = program_dict['program_annotation']\n",
    "    computations_dict = program_json['computations']\n",
    "    ordered_comp_list = sorted(list(computations_dict.keys()), key = lambda x: computations_dict[x]['absolute_order'])\n",
    "    \n",
    "    for comp_index, comp_name in enumerate(ordered_comp_list):\n",
    "        comp_dict = computations_dict[comp_name]\n",
    "        if len(comp_dict['accesses'])>max_accesses:\n",
    "            raise NbAccessException\n",
    "        if len(comp_dict['accesses'])<min_accesses:\n",
    "            raise NbAccessException\n",
    "        if len(comp_dict['iterators'])>max_depth:\n",
    "            raise LoopsDepthException\n",
    "            \n",
    "        comp_repr_template = []\n",
    "        # Is this computation a reduction \n",
    "        comp_repr_template.append(+comp_dict['comp_is_reduction'])\n",
    "\n",
    "\n",
    "#         iterators representation + tiling and interchage\n",
    "        iterators_repr = []\n",
    "        for iter_i,iterator_name in enumerate(comp_dict['iterators']):\n",
    "            iterator_dict = program_json['iterators'][iterator_name]\n",
    "            iterators_repr.extend([iterator_dict['lower_bound'], iterator_dict['upper_bound']])\n",
    "            \n",
    "            # transformations placeholders\n",
    "            c_code = 'C'+str(comp_index)\n",
    "            l_code= c_code+'-L'+str(iter_i)\n",
    "            iterators_repr.extend([l_code+'Parallelized',\n",
    "                                   l_code+'Tiled', l_code+'TileFactor',\n",
    "                                   l_code+'Fused']) #unrolling is skipped since it is only applied on innermost loop\n",
    "\n",
    "        # Adding padding\n",
    "        iterator_repr_size = int(len(iterators_repr)/len(comp_dict['iterators']))\n",
    "        iterators_repr.extend([0]*iterator_repr_size*(max_depth-len(comp_dict['iterators']))) # adding iterators padding \n",
    "\n",
    "        # Adding unrolling placeholder since unrolling can only be applied to the innermost loop \n",
    "        iterators_repr.extend([c_code+'-Unrolled', c_code+'-UnrollFactor'])\n",
    "        \n",
    "        # Adding transformation matrix place holder\n",
    "        iterators_repr.append(c_code+'-TransformationMatrixStart')\n",
    "        iterators_repr.extend(['M']*((max_depth+1)**2-2))\n",
    "        iterators_repr.append(c_code+'-TransformationMatrixEnd')\n",
    "    \n",
    "        # Adding the iterators representation to computation vector\n",
    "        comp_repr_template.extend(iterators_repr)     \n",
    "\n",
    "        #  Write access representation to computation vector\n",
    "        padded_write_matrix = pad_access_matrix(isl_to_write_matrix(comp_dict['write_access_relation']), max_depth)\n",
    "        write_access_repr = [comp_dict['write_buffer_id']+1] + padded_write_matrix.flatten().tolist() # buffer_id + flattened access matrix \n",
    "        \n",
    "        # Adding write access representation to computation vector\n",
    "        comp_repr_template.extend(write_access_repr)\n",
    "\n",
    "        # Read Access representation \n",
    "        read_accesses_repr=[]\n",
    "        for read_access_dict in comp_dict['accesses']:\n",
    "            read_access_matrix = pad_access_matrix(read_access_dict['access_matrix'], max_depth)\n",
    "            read_access_repr = [+read_access_dict['access_is_reduction']]+ [read_access_dict['buffer_id']+1] + read_access_matrix.flatten().tolist() # buffer_id + flattened access matrix \n",
    "            read_accesses_repr.extend(read_access_repr)\n",
    "\n",
    "        access_repr_len = (max_depth+1)*(max_depth + 2) + 1 +1 # access matrix size +1 for buffer id +1 for is_access_reduction\n",
    "        read_accesses_repr.extend([0]*access_repr_len*(max_accesses-len(comp_dict['accesses']))) #adding accesses padding\n",
    "\n",
    "    \n",
    "        comp_repr_template.extend(read_accesses_repr)\n",
    "\n",
    "        # Adding Operations count to computation vector\n",
    "        comp_repr_template.append(comp_dict['number_of_additions'])\n",
    "        comp_repr_template.append(comp_dict['number_of_subtraction'])\n",
    "        comp_repr_template.append(comp_dict['number_of_multiplication'])\n",
    "        comp_repr_template.append(comp_dict['number_of_division'])\n",
    "        \n",
    "\n",
    "        # adding log(x+1) of the representation\n",
    "#         log_rep = list(np.log1p(comp_representation))\n",
    "#         comp_representation.extend(log_rep)\n",
    "        \n",
    "        comps_repr_templates_list.append(comp_repr_template)\n",
    "        comps_indices_dict[comp_name] = comp_index\n",
    "        for j, element in enumerate(comp_repr_template):\n",
    "            if isinstance(element, str):\n",
    "                comps_placeholders_indices_dict[element] = (comp_index,j)\n",
    "    \n",
    "\n",
    "        \n",
    "    #building loop representation template\n",
    "    \n",
    "    loops_repr_templates_list = []\n",
    "    loops_indices_dict = dict()\n",
    "    loops_placeholders_indices_dict = dict()\n",
    "#     assert len(program_json['iterators'])==len(set(program_json['iterators'])) #just to make sure that loop names are not duplicates, but this can't happen because it's a dict\n",
    "    for loop_index, loop_name in enumerate(program_json['iterators']): # !! is the order in this list fix? can't we get new indices during schedule repr !!! should we use loop name in plchldrs instead of index ? !! #Edit: now it's using the name, so this issue shouldn't occure\n",
    "        loop_repr_template=[]\n",
    "        l_code = 'L'+loop_name\n",
    "        # upper and lower bound\n",
    "        loop_repr_template.extend([program_json['iterators'][loop_name]['lower_bound'],program_json['iterators'][loop_name]['upper_bound']])   \n",
    "        loop_repr_template.extend([l_code+'Parallelized',\n",
    "                                   l_code+'Tiled', l_code+'TileFactor',\n",
    "                                   l_code+'Fused',\n",
    "                                   l_code+'Unrolled', l_code+'UnrollFactor'])\n",
    "        loop_repr_template.extend([l_code+'TransfMatRowStart']+['M']*(max_depth-2+1)+[l_code+'TransfMatRowEnd']) #+1 for the frame\n",
    "        loop_repr_template.extend([l_code+'TransfMatColStart']+['M']*(max_depth-2+1)+[l_code+'TransfMatColEnd'])\n",
    "        # adding log(x+1) of the loop representation\n",
    "        loops_repr_templates_list.append(loop_repr_template)    \n",
    "        loops_indices_dict[loop_name]=loop_index\n",
    "        \n",
    "        for j, element in enumerate(loop_repr_template):\n",
    "            if isinstance(element, str):\n",
    "                loops_placeholders_indices_dict[element] = (loop_index,j)\n",
    "    \n",
    "            \n",
    "     \n",
    "    def update_tree_atributes(node):     \n",
    "        node['loop_index'] = torch.tensor(loops_indices_dict[node['loop_name']]).to(train_device)\n",
    "        if node['computations_list']!=[]:\n",
    "            node['computations_indices'] = torch.tensor([comps_indices_dict[comp_name] for comp_name in node['computations_list']]).to(train_device)\n",
    "            node['has_comps'] = True\n",
    "        else:\n",
    "            node['has_comps'] = False\n",
    "        for child_node in node['child_list']:\n",
    "            update_tree_atributes(child_node)\n",
    "        return node\n",
    "    \n",
    "    # getting the original tree structure \n",
    "    no_sched_json = program_dict['schedules_list'][0]\n",
    "    assert 'fusions' not in no_sched_json or no_sched_json['fusions']==None\n",
    "    orig_tree_structure = no_sched_json['tree_structure']\n",
    "    tree_annotation = copy.deepcopy(orig_tree_structure) #to avoid altering the original tree from the json\n",
    "    prog_tree = update_tree_atributes(tree_annotation) \n",
    "    \n",
    "#     loops_tensor = torch.unsqueeze(torch.FloatTensor(loops_repr_templates_list),0)#.to(device)\n",
    "#     computations_tensor = torch.unsqueeze(torch.FloatTensor(comps_repr_templates_list),0)#.to(device)     \n",
    "\n",
    "    return prog_tree, comps_repr_templates_list, loops_repr_templates_list, comps_placeholders_indices_dict, loops_placeholders_indices_dict\n",
    "\n",
    "\n",
    "def get_schedule_representation(program_json, schedule_json, comps_repr_templates_list, loops_repr_templates_list, comps_placeholders_indices_dict, loops_placeholders_indices_dict, max_depth):\n",
    "\n",
    "    comps_repr = copy.deepcopy(comps_repr_templates_list)\n",
    "    loops_repr = copy.deepcopy(loops_repr_templates_list)\n",
    "    \n",
    "    computations_dict = program_json['computations']\n",
    "    ordered_comp_list = sorted(list(computations_dict.keys()), key = lambda x: computations_dict[x]['absolute_order'])\n",
    "    \n",
    "    padded_tranf_mat_per_comp = dict()\n",
    "    \n",
    "    for comp_index, comp_name in enumerate(ordered_comp_list):\n",
    "        comp_dict =  program_json['computations'][comp_name]\n",
    "        comp_schedule_dict=schedule_json[comp_name]\n",
    "        c_code = 'C'+str(comp_index)\n",
    "        \n",
    "        \n",
    "        #Fusion representation\n",
    "        fused_levels = []\n",
    "        if 'fusions' in schedule_json and schedule_json['fusions']:\n",
    "            for fusion in schedule_json['fusions']:#check if comp is involved in fusions \n",
    "                 # fusions format [compname1, compname2, loop depth]\n",
    "                if comp_name in fusion:\n",
    "                    fused_levels.append(fusion[2])\n",
    "                \n",
    "            \n",
    "        for iter_i,iterator_name in enumerate(comp_dict['iterators']):\n",
    "            \n",
    "            ### Updating the computations representation template \n",
    "            l_code= c_code+'-L'+str(iter_i)\n",
    "            \n",
    "             # Parallelization representation\n",
    "            parallelized = 0\n",
    "            if iterator_name == comp_schedule_dict['parallelized_dim']:\n",
    "                parallelized = 1 # parallelized true\n",
    "            p_index = comps_placeholders_indices_dict[l_code+'Parallelized']\n",
    "            comps_repr[p_index[0]][p_index[1]]=parallelized\n",
    "            \n",
    "            # Tiling representation \n",
    "            tiled = 0\n",
    "            tile_factor = 0\n",
    "            if comp_schedule_dict['tiling'] and (iterator_name in comp_schedule_dict['tiling']['tiling_dims']):\n",
    "                tiled = 1 #tiled: true\n",
    "                tile_factor_index = comp_schedule_dict['tiling']['tiling_dims'].index(iterator_name)\n",
    "                tile_factor = int(comp_schedule_dict['tiling']['tiling_factors'][tile_factor_index]) #tile factor\n",
    "            p_index = comps_placeholders_indices_dict[l_code+'Tiled']\n",
    "            comps_repr[p_index[0]][p_index[1]] = tiled\n",
    "            p_index = comps_placeholders_indices_dict[l_code+'TileFactor']\n",
    "            comps_repr[p_index[0]][p_index[1]] = tile_factor\n",
    "            \n",
    "            # Fusion representation\n",
    "            fused = 0\n",
    "            if iter_i in fused_levels:\n",
    "                fused=1\n",
    "            p_index = comps_placeholders_indices_dict[l_code+'Fused']\n",
    "            comps_repr[p_index[0]][p_index[1]] = fused\n",
    "            \n",
    "\n",
    "         # Unrolling Representation \n",
    "        unrolled = 0\n",
    "        unroll_factor = 0\n",
    "        if comp_schedule_dict['unrolling_factor']: #Unrolling is always aplied to the innermost loop \n",
    "            unrolled=1 #unrolled True\n",
    "            unroll_factor = int(comp_schedule_dict['unrolling_factor']) #unroll factor\n",
    "        p_index = comps_placeholders_indices_dict[c_code+'-Unrolled']\n",
    "        comps_repr[p_index[0]][p_index[1]] = unrolled\n",
    "        p_index = comps_placeholders_indices_dict[c_code+'-UnrollFactor']\n",
    "        comps_repr[p_index[0]][p_index[1]] = unroll_factor\n",
    "        \n",
    "        # Adding the transformation matrix\n",
    "        # get the matrix start and end indices \n",
    "        mat_start = comps_placeholders_indices_dict[c_code+'-TransformationMatrixStart']\n",
    "        mat_end = comps_placeholders_indices_dict[c_code+'-TransformationMatrixEnd']\n",
    "        nb_mat_elements = mat_end[1] - mat_start[1] + 1\n",
    "        max_depth = int(np.sqrt(nb_mat_elements))-1 # temporarily hack to get max_depth to use it in padding\n",
    "        padded_matrix = get_padded_transformation_matrix(program_json, schedule_json, comp_name, max_depth)\n",
    "    #     print(nb_mat_elements, padded_matrix, max_depth)\n",
    "        assert len(padded_matrix.flatten().tolist()) == nb_mat_elements\n",
    "    #     print(nb_mat_elements)\n",
    "        comps_repr[mat_start[0]][mat_start[1]:mat_end[1]+1] = padded_matrix.flatten().tolist() \n",
    "        \n",
    "        padded_tranf_mat_per_comp[comp_name] = padded_matrix #saving it for later to be used in loop repr\n",
    "        \n",
    "#     # transforming the schedule_json in order to have loops as key instead of computations, this dict helps building the loop vectors\n",
    "    loop_schedules_dict = dict()\n",
    "    for loop_name in program_json['iterators']:\n",
    "        loop_schedules_dict[loop_name]=dict()\n",
    "        loop_schedules_dict[loop_name]['TransformationMatrixCol']=[]\n",
    "        loop_schedules_dict[loop_name]['TransformationMatrixRow']=[]\n",
    "        loop_schedules_dict[loop_name]['tiled']=0\n",
    "        loop_schedules_dict[loop_name]['tile_factor']=0\n",
    "        loop_schedules_dict[loop_name]['unrolled']=0\n",
    "        loop_schedules_dict[loop_name]['unroll_factor']=0\n",
    "        loop_schedules_dict[loop_name]['parallelized']=0\n",
    "        loop_schedules_dict[loop_name]['fused']=0\n",
    "        \n",
    "    for comp_index, comp_name in enumerate(ordered_comp_list):\n",
    "        comp_schedule_dict = schedule_json[comp_name]\n",
    "        if comp_schedule_dict['tiling']:\n",
    "            for tiled_loop_index,tiled_loop in enumerate(comp_schedule_dict['tiling']['tiling_dims']):\n",
    "                loop_schedules_dict[tiled_loop]['tiled']=1\n",
    "                assert loop_schedules_dict[tiled_loop]['tile_factor']==0 or loop_schedules_dict[tiled_loop]['tile_factor']==int(comp_schedule_dict['tiling']['tiling_factors'][tiled_loop_index]) #just checking that it hasn't been updated with a different value\n",
    "                loop_schedules_dict[tiled_loop]['tile_factor']=int(comp_schedule_dict['tiling']['tiling_factors'][tiled_loop_index])\n",
    "        if comp_schedule_dict['unrolling_factor']:\n",
    "            comp_innermost_loop=computations_dict[comp_name]['iterators'][-1] \n",
    "            loop_schedules_dict[comp_innermost_loop]['unrolled']=1\n",
    "            assert loop_schedules_dict[comp_innermost_loop]['unroll_factor']==0 or loop_schedules_dict[comp_innermost_loop]['unroll_factor']==int(comp_schedule_dict['unrolling_factor'])  #just checking that it hasn't been updated with a different value\n",
    "            loop_schedules_dict[comp_innermost_loop]['unroll_factor']=int(comp_schedule_dict['unrolling_factor'])\n",
    "        if comp_schedule_dict['parallelized_dim']:\n",
    "            loop_schedules_dict[comp_schedule_dict['parallelized_dim']]['parallelized'] = 1\n",
    "        \n",
    "        # get the rows and cols transformation matrix for each iterator\n",
    "        assert padded_tranf_mat_per_comp[comp_name].shape == (max_depth+1,max_depth+1) # make sure that the padding frame is applied, otherwise need to remove the +1 from iter_i+1 in the next few lines \n",
    "        for iter_i, loop_name in enumerate(computations_dict[comp_name]['iterators']):\n",
    "            if len(loop_schedules_dict[loop_name]['TransformationMatrixCol'])>0:#if not empty\n",
    "                assert (loop_schedules_dict[loop_name]['TransformationMatrixCol'] == padded_tranf_mat_per_comp[comp_name][:,iter_i+1]).all() #chck if the iterator what affected by a different matrix, that shouldn't happen\n",
    "            else:\n",
    "                loop_schedules_dict[loop_name]['TransformationMatrixCol'] = padded_tranf_mat_per_comp[comp_name][:,iter_i+1] #+1 for the padding frame\n",
    "            if len(loop_schedules_dict[loop_name]['TransformationMatrixRow'])>0:#if not empty\n",
    "                assert (loop_schedules_dict[loop_name]['TransformationMatrixRow'] == padded_tranf_mat_per_comp[comp_name][iter_i+1,:]).all() #chck if the iterator what affected by a different matrix, that shouldn't happen\n",
    "            else:\n",
    "                loop_schedules_dict[loop_name]['TransformationMatrixRow'] = padded_tranf_mat_per_comp[comp_name][iter_i+1,:]#+1 for the padding frame\n",
    "    \n",
    "    #update the fusions in loops dict \n",
    "    if 'fusions' in schedule_json and schedule_json['fusions']:\n",
    "        for fusion in schedule_json['fusions']:\n",
    "            fused_loop1 = computations_dict[fusion[0]]['iterators'][fusion[2]]\n",
    "            fused_loop2 = computations_dict[fusion[1]]['iterators'][fusion[2]]\n",
    "            loop_schedules_dict[fused_loop1]['fused']=1\n",
    "            loop_schedules_dict[fused_loop2]['fused']=1\n",
    "        \n",
    "# Updating the loop representation templates\n",
    "    for loop_name in program_json['iterators']:\n",
    "        l_code = 'L'+loop_name\n",
    "        \n",
    "        p_index = loops_placeholders_indices_dict[l_code+'Parallelized']\n",
    "        loops_repr[p_index[0]][p_index[1]] = loop_schedules_dict[loop_name]['parallelized']\n",
    "        \n",
    "        p_index = loops_placeholders_indices_dict[l_code+'Tiled']\n",
    "        loops_repr[p_index[0]][p_index[1]] = loop_schedules_dict[loop_name]['tiled']\n",
    "        p_index = loops_placeholders_indices_dict[l_code+'TileFactor']\n",
    "        loops_repr[p_index[0]][p_index[1]] = loop_schedules_dict[loop_name]['tile_factor']\n",
    "        \n",
    "        p_index = loops_placeholders_indices_dict[l_code+'Unrolled']\n",
    "        loops_repr[p_index[0]][p_index[1]] = loop_schedules_dict[loop_name]['unrolled']\n",
    "        p_index = loops_placeholders_indices_dict[l_code+'UnrollFactor']\n",
    "        loops_repr[p_index[0]][p_index[1]] = loop_schedules_dict[loop_name]['unroll_factor']\n",
    "        \n",
    "        p_index = loops_placeholders_indices_dict[l_code+'Fused']\n",
    "        loops_repr[p_index[0]][p_index[1]] = loop_schedules_dict[loop_name]['fused']\n",
    "        \n",
    "        row_start = loops_placeholders_indices_dict[l_code+'TransfMatRowStart']\n",
    "        row_end = loops_placeholders_indices_dict[l_code+'TransfMatRowEnd']\n",
    "        nb_row_elements = row_end[1] - row_start[1] + 1\n",
    "        assert len(loop_schedules_dict[loop_name]['TransformationMatrixRow']) == nb_row_elements\n",
    "        loops_repr[row_start[0]][row_start[1]:row_end[1]+1] = loop_schedules_dict[loop_name]['TransformationMatrixRow']\n",
    "        \n",
    "        col_start = loops_placeholders_indices_dict[l_code+'TransfMatColStart']\n",
    "        col_end = loops_placeholders_indices_dict[l_code+'TransfMatColEnd']\n",
    "        nb_col_elements = col_end[1] - col_start[1] + 1\n",
    "        assert len(loop_schedules_dict[loop_name]['TransformationMatrixCol']) == nb_col_elements\n",
    "        loops_repr[col_start[0]][col_start[1]:col_end[1]+1] = loop_schedules_dict[loop_name]['TransformationMatrixCol']\n",
    "    \n",
    "    loops_tensor = torch.unsqueeze(torch.FloatTensor(loops_repr),0)#.to(device)\n",
    "    computations_tensor = torch.unsqueeze(torch.FloatTensor(comps_repr),0)#.to(device)     \n",
    "\n",
    "    return computations_tensor, loops_tensor\n",
    "\n",
    "\n",
    "global_dioph_sols_dict = dict()\n",
    "def get_padded_transformation_matrix(program_json, schedule_json, comp_name, max_depth=None):\n",
    "    comp_name = list(program_json['computations'].keys())[0] # for single comp programs, there is only one computation\n",
    "    comp_dict =  program_json['computations'][comp_name]\n",
    "    comp_schedule_dict=schedule_json[comp_name]\n",
    "    nb_iterators = len(comp_dict['iterators'])\n",
    "    loop_nest = comp_dict['iterators'][:]\n",
    "    \n",
    "    if 'transformation_matrix' in comp_schedule_dict: # if the program is explored using matrices\n",
    "        if comp_schedule_dict['transformation_matrix']!=[]: #if matrix applied, else set it to identity\n",
    "            assert np.sqrt(len(comp_schedule_dict['transformation_matrix']))==nb_iterators\n",
    "            final_mat = np.array(list(map(int,comp_schedule_dict['transformation_matrix']))).reshape(nb_iterators,nb_iterators)\n",
    "        else:\n",
    "            final_mat = np.zeros((nb_iterators,nb_iterators),int)\n",
    "            np.fill_diagonal(final_mat,1)\n",
    "        # just for checking\n",
    "        comparison_matrix = np.zeros((nb_iterators,nb_iterators),int)\n",
    "        np.fill_diagonal(comparison_matrix,1)\n",
    "        for mat in comp_schedule_dict['transformation_matrices'][::-1]:\n",
    "            comparison_matrix = comparison_matrix@np.array(list(map(int,mat))).reshape(nb_iterators,nb_iterators)\n",
    "        assert (comparison_matrix==final_mat).all()\n",
    "    else: # if the program is explored using tags\n",
    "        interchange_matrix = np.zeros((nb_iterators,nb_iterators),int)\n",
    "        np.fill_diagonal(interchange_matrix,1)\n",
    "        if comp_schedule_dict['interchange_dims']:\n",
    "            first_iter_index = loop_nest.index(comp_schedule_dict['interchange_dims'][0])\n",
    "            second_iter_index = loop_nest.index(comp_schedule_dict['interchange_dims'][1])\n",
    "            interchange_matrix[first_iter_index,first_iter_index]=0 #zeroing the diagonal elements\n",
    "            interchange_matrix[second_iter_index,second_iter_index]=0 #zeroing the diagonal elements\n",
    "            interchange_matrix[first_iter_index, second_iter_index]=1\n",
    "            interchange_matrix[second_iter_index, first_iter_index]=1\n",
    "            loop_nest[first_iter_index], loop_nest[second_iter_index] = loop_nest[second_iter_index], loop_nest[first_iter_index] # swapping iterators in loop nest\n",
    "\n",
    "        skewing_matrix = np.zeros((nb_iterators,nb_iterators),int)\n",
    "        np.fill_diagonal(skewing_matrix,1)\n",
    "        if comp_schedule_dict['skewing']:\n",
    "            first_iter_index = loop_nest.index(comp_schedule_dict['skewing']['skewed_dims'][0])\n",
    "            second_iter_index = loop_nest.index(comp_schedule_dict['skewing']['skewed_dims'][1])\n",
    "            first_factor = int(comp_schedule_dict['skewing']['skewing_factors'][0])\n",
    "            second_factor = int(comp_schedule_dict['skewing']['skewing_factors'][1])\n",
    "            # the skewing sub matrix should be in the form of \n",
    "            # [[fact1, fact2],\n",
    "            #  [a,   , b    ]]\n",
    "            # and we need to find a and b to make to matix det==1\n",
    "    #         a, b = symbols('a b')\n",
    "    #         sol = diophantine(first_factor*b - second_factor*a - 1) # solve the diophantine equation to keep a determinant of 1 in the matrix, \n",
    "    #         a, b = list(sol)[0] # since we know that there should at least (or only?) one solution \n",
    "    #         free_symbol = list(a.free_symbols)[0] # since we know that there should be only one free symbol\n",
    "    #         a = int(a.subs({free_symbol:0})) #substitue the free symbol with 0 to get the initial solution\n",
    "    #         b = int(b.subs({free_symbol:0}))\n",
    "#             sol = simple_linear_diophantine_r(first_factor,second_factor)\n",
    "            if (first_factor,second_factor) in global_dioph_sols_dict:\n",
    "                a, b = global_dioph_sols_dict[(first_factor,second_factor)]\n",
    "            else: \n",
    "                a, b = linear_diophantine_default(first_factor,second_factor)\n",
    "            skewing_matrix[first_iter_index,first_iter_index] = first_factor # update the matrix\n",
    "            skewing_matrix[first_iter_index,second_iter_index] = second_factor\n",
    "            skewing_matrix[second_iter_index,first_iter_index] = a\n",
    "            skewing_matrix[second_iter_index,second_iter_index] = b\n",
    "\n",
    "        #multiply the mats \n",
    "        final_mat = skewing_matrix@interchange_matrix # Right order is skew_mat * interchange_mat\n",
    "    \n",
    "    padded_mat = final_mat\n",
    "    \n",
    "    \n",
    "    #pad matrix if max_depth defined\n",
    "    if max_depth!=None:\n",
    "        padded_mat = np.c_[np.ones(padded_mat.shape[0]), padded_mat] # adding tags for marking the used rows\n",
    "        padded_mat = np.r_[[np.ones(padded_mat.shape[1])], padded_mat] # adding tags for marking the used columns\n",
    "        padded_mat = np.pad(padded_mat, [(0,max_depth-nb_iterators),(0,max_depth-nb_iterators)], mode='constant', constant_values=0)\n",
    "    \n",
    "    return padded_mat\n",
    "\n",
    "    \n",
    "def get_datapoint_attributes(func_name, program_dict, schedule_index, tree_footprint):\n",
    "    schedule_json = program_dict['schedules_list'][schedule_index]\n",
    "    sched_id = str(schedule_index).zfill(4)\n",
    "    sched_str = sched_json_to_sched_str(schedule_json)\n",
    "    exec_time = np.min(schedule_json['execution_times'])\n",
    "    memory_use = program_dict['program_annotation']['memory_size']\n",
    "    node_name = program_dict['node_name'] if 'node_name' in program_dict else 'unknown'\n",
    "    speedup = program_dict['initial_execution_time']/exec_time \n",
    "\n",
    "    return (func_name, sched_id, sched_str, exec_time, memory_use, node_name, tree_footprint, speedup)\n",
    "\n",
    "def sched_json_to_sched_str(sched_json): \n",
    "    \n",
    "    if 'sched_str' in sched_json:\n",
    "        return sched_json['sched_str']\n",
    "    \n",
    "    orig_loop_nest = []\n",
    "    orig_loop_nest.append(sched_json['tree_structure']['loop_name'])\n",
    "    child_list = sched_json['tree_structure']['child_list']\n",
    "    while len(child_list)>0:\n",
    "        child_loop = child_list[0]\n",
    "        orig_loop_nest.append(child_loop['loop_name'])\n",
    "        child_list = child_loop['child_list']\n",
    "        \n",
    "    comp_name = [n for n in sched_json.keys() if not n in ['unfuse_iterators','tree_structure','execution_times']][0]\n",
    "    schedule = sched_json[comp_name]\n",
    "    transf_loop_nest = orig_loop_nest\n",
    "    sched_str = ''\n",
    "    \n",
    "    if 'Transformation Matrix' in schedule:\n",
    "        if schedule['Transformation Matrix']:\n",
    "            sched_str+='M('+','.join(schedule['Transformation Matrix'])+')'\n",
    "    elif \"transformation_matrix\" in schedule:\n",
    "        if schedule['transformation_matrix']:\n",
    "            sched_str+='M('+','.join(schedule['transformation_matrix'])+')'\n",
    "    if schedule['interchange_dims']:\n",
    "        first_dim_index = transf_loop_nest.index(schedule['interchange_dims'][0])\n",
    "        second_dim_index = transf_loop_nest.index(schedule['interchange_dims'][1])\n",
    "        sched_str+='I(L'+str(first_dim_index)+',L'+str(second_dim_index)+')'\n",
    "        transf_loop_nest[first_dim_index], transf_loop_nest[second_dim_index] = transf_loop_nest[second_dim_index], transf_loop_nest[first_dim_index]\n",
    "    if schedule['skewing']:\n",
    "        first_dim_index = transf_loop_nest.index(schedule['skewing']['skewed_dims'][0])\n",
    "        second_dim_index = transf_loop_nest.index(schedule['skewing']['skewed_dims'][1])\n",
    "        first_factor = schedule['skewing']['skewing_factors'][0]\n",
    "        second_factor = schedule['skewing']['skewing_factors'][1]\n",
    "        sched_str+='S(L'+str(first_dim_index)+',L'+str(second_dim_index)+','+str(first_factor)+','+str(second_factor)+')'\n",
    "    if schedule['parallelized_dim']:\n",
    "        dim_index = transf_loop_nest.index(schedule['parallelized_dim'])\n",
    "        sched_str+='P(L'+str(dim_index)+')'\n",
    "    if schedule['tiling']:\n",
    "        if schedule['tiling']['tiling_depth']==2:\n",
    "            first_dim = schedule['tiling']['tiling_dims'][0]\n",
    "            second_dim = schedule['tiling']['tiling_dims'][1]\n",
    "            first_dim_index = transf_loop_nest.index(first_dim)\n",
    "            second_dim_index = transf_loop_nest.index(second_dim)\n",
    "            first_factor = schedule['tiling']['tiling_factors'][0]\n",
    "            second_factor = schedule['tiling']['tiling_factors'][1]\n",
    "            sched_str+='T2(L'+str(first_dim_index)+',L'+str(second_dim_index)+','+str(first_factor)+','+str(second_factor)+')'\n",
    "            i = transf_loop_nest.index(first_dim)\n",
    "            transf_loop_nest[i:i+1]=first_dim+'_outer', second_dim+'_outer'\n",
    "            i = transf_loop_nest.index(second_dim)\n",
    "            transf_loop_nest[i:i+1]=first_dim+'_inner', second_dim+'_inner'\n",
    "        else: #tiling depth == 3\n",
    "            first_dim = schedule['tiling']['tiling_dims'][0]\n",
    "            second_dim = schedule['tiling']['tiling_dims'][1]\n",
    "            third_dim = schedule['tiling']['tiling_dims'][2]\n",
    "            first_dim_index = transf_loop_nest.index(first_dim)\n",
    "            second_dim_index = transf_loop_nest.index(second_dim)\n",
    "            third_dim_index = transf_loop_nest.index(third_dim)\n",
    "            first_factor = schedule['tiling']['tiling_factors'][0]\n",
    "            second_factor = schedule['tiling']['tiling_factors'][1]\n",
    "            third_factor = schedule['tiling']['tiling_factors'][2]\n",
    "            sched_str+='T3(L'+str(first_dim_index)+',L'+str(second_dim_index)+',L'+str(third_dim_index)+','+str(first_factor)+','+str(second_factor)+','+str(third_factor)+')'\n",
    "            i = transf_loop_nest.index(first_dim)\n",
    "            transf_loop_nest[i:i+1]=first_dim+'_outer', second_dim+'_outer', third_dim+'_outer'\n",
    "            i = transf_loop_nest.index(second_dim)\n",
    "            transf_loop_nest[i:i+1]=first_dim+'_inner', second_dim+'_inner', third_dim+'_inner'\n",
    "            transf_loop_nest.remove(third_dim)\n",
    "    if schedule['unrolling_factor']:\n",
    "        dim_index = len(transf_loop_nest)-1\n",
    "        dim_name =transf_loop_nest[-1]\n",
    "        sched_str+='U(L'+str(dim_index)+','+schedule['unrolling_factor']+')'\n",
    "        transf_loop_nest[dim_index:dim_index+1] = dim_name+'_Uouter', dim_name+'_Uinner'\n",
    "    \n",
    "    \n",
    "    return sched_str\n",
    "    \n",
    "def pad_access_matrix(access_matrix, max_depth):\n",
    "    access_matrix = np.array(access_matrix)\n",
    "    access_matrix = np.c_[np.ones(access_matrix.shape[0]), access_matrix] # adding tags for marking the used rows\n",
    "    access_matrix = np.r_[[np.ones(access_matrix.shape[1])], access_matrix] # adding tags for marking the used columns\n",
    "    padded_access_matrix = np.zeros((max_depth + 1, max_depth + 2))\n",
    "    padded_access_matrix[:access_matrix.shape[0],:access_matrix.shape[1]-1] = access_matrix[:,:-1] #adding padding to the access matrix before the last column\n",
    "    padded_access_matrix[:access_matrix.shape[0],-1] = access_matrix[:,-1] #appending the last columns\n",
    "    \n",
    "    return padded_access_matrix\n",
    "\n",
    "def isl_to_write_matrix(isl_map): # for now this function only support reductions\n",
    "    comp_iterators_str = re.findall(r'\\[(.*)\\]\\s*->', isl_map)[0]\n",
    "    buffer_iterators_str = re.findall(r'->\\s*\\w*\\[(.*)\\]', isl_map)[0]\n",
    "    buffer_iterators_str=re.sub(r\"\\w+'\\s=\",\"\",buffer_iterators_str)\n",
    "    comp_iter_names = re.findall(r'(?:\\s*(\\w+))+', comp_iterators_str)\n",
    "    buf_iter_names = re.findall(r'(?:\\s*(\\w+))+', buffer_iterators_str)\n",
    "    matrix = np.zeros([len(buf_iter_names),len(comp_iter_names)+1])\n",
    "    for i,buf_iter in enumerate(buf_iter_names):\n",
    "        for j,comp_iter in enumerate(comp_iter_names):\n",
    "            if buf_iter==comp_iter:\n",
    "                matrix[i,j]=1\n",
    "                break\n",
    "    return matrix\n",
    "\n",
    "def isl_to_write_dims(isl_map): # return the buffer iterator that defines the write buffer\n",
    "    buffer_iterators_str = re.findall(r'->\\s*\\w*\\[(.*)\\]', isl_map)[0]\n",
    "    buffer_iterators_str = re.sub(r\"\\w+'\\s=\",\"\",buffer_iterators_str)\n",
    "    buf_iter_names = re.findall(r'(?:\\s*(\\w+))+', buffer_iterators_str)\n",
    "    return buf_iter_names\n",
    "\n",
    "def get_results_df(dataset, batches_list, indices, model, log=False):   \n",
    "    df = pd.DataFrame()\n",
    "    model.eval()\n",
    "    torch.set_grad_enabled(False)\n",
    "    all_outputs=[]\n",
    "    all_labels=[]\n",
    "    prog_names=[]\n",
    "    sched_names=[]\n",
    "    exec_times=[]\n",
    "    sched_strs=[]\n",
    "    memory_uses=[]\n",
    "    node_names=[]\n",
    "    tree_footprints = []\n",
    "\n",
    "    for k, (inputs, labels) in tqdm(list(enumerate(batches_list))):\n",
    "        original_device = labels.device\n",
    "        inputs=(inputs[0], inputs[1].to(train_device), inputs[2].to(train_device))\n",
    "        labels=labels.to(train_device)\n",
    "        outputs = model(inputs)\n",
    "        assert outputs.shape == labels.shape\n",
    "        all_outputs.append(outputs)\n",
    "        all_labels.append(labels)\n",
    "#         assert len(outputs)==len(dataset.batched_schedule_names[indices[k]])\n",
    "#         assert len(outputs)==len(dataset.batched_program_names[indices[k]])\n",
    "#         for j, sched_name in enumerate(dataset.batched_schedule_names[indices[k]]):\n",
    "#             sched_names.append(sched_name)\n",
    "#             prog_names.append(dataset.batched_program_names[indices[k]][j])\n",
    "#             exec_times.append(dataset.batched_exec_time[indices[k]][j])\n",
    "        assert len(outputs)==len(dataset.batched_datapoint_attributes[indices[k]])\n",
    "        zipped_attributes = list(zip(*dataset.batched_datapoint_attributes[indices[k]]))\n",
    "        prog_names.extend(zipped_attributes[0])\n",
    "        sched_names.extend(zipped_attributes[1])\n",
    "        sched_strs.extend(zipped_attributes[2])\n",
    "        exec_times.extend(zipped_attributes[3])\n",
    "        memory_uses.extend(zipped_attributes[4])\n",
    "        node_names.extend(zipped_attributes[5])\n",
    "        tree_footprints.extend(zipped_attributes[6])\n",
    "        inputs=(inputs[0], inputs[1].to(original_device), inputs[2].to(original_device))\n",
    "        labels=labels.to(original_device)\n",
    "    preds = torch.cat(all_outputs)\n",
    "    targets = torch.cat(all_labels)\n",
    "    preds = preds.cpu().detach().numpy().reshape((-1,))\n",
    "    preds = np.around(preds,decimals=6)\n",
    "    targets = np.around(targets.cpu().detach().numpy().reshape((-1,)),decimals=6)\n",
    "                                            \n",
    "    assert preds.shape == targets.shape \n",
    "    df['name'] = prog_names\n",
    "    df['tree_struct'] = tree_footprints\n",
    "    df['sched_name'] = sched_names\n",
    "    df['sched_str'] = sched_strs\n",
    "    df['exec_time'] = exec_times\n",
    "    df['memory_use'] = list(map(float,memory_uses))\n",
    "    df['node_name'] = node_names\n",
    "    df['prediction'] = np.array(preds)\n",
    "    df['target'] = np.array(targets)\n",
    "#     df['abs_diff'] = np.abs(preds - targets)\n",
    "    df['APE'] = np.abs(df.target - df.prediction)/df.target * 100\n",
    "    df['sched_str'] = df['sched_str'].apply(lambda x: simplify_sched_str(x))\n",
    "        \n",
    "    return df\n",
    "\n",
    "def simplify_sched_str(sched_str): #checks if the the same matrix is applied multiple computations, then merge the M() parts into a single \n",
    "#     print('before ')\n",
    "    if sched_str.count('M')==1:\n",
    "        return sched_str\n",
    "    comps = re.findall('C\\d+', sched_str)\n",
    "    comps = set(comps)\n",
    "    \n",
    "    mats = set(re.findall(r'M\\({[\\dC\\,]+},([\\d\\,\\-]+)',sched_str))\n",
    "    comps_per_mat = {mat:[] for mat in mats}\n",
    "    new_mats_str = ''\n",
    "    for mat in comps_per_mat:\n",
    "        for mat_part in re.findall('M\\({[C\\d\\,]+},'+mat,sched_str):\n",
    "            comps_per_mat[mat].extend(re.findall('C\\d+',mat_part))\n",
    "        new_mats_str+='M({'+','.join(sorted(comps_per_mat[mat]))+'},'+mat+')'\n",
    "    return re.sub('(M\\({[\\dC\\,]+},[\\d\\,\\-]+\\))+',new_mats_str,sched_str)\n",
    "\n",
    "\n",
    "# In[5]:\n",
    "\n",
    "\n",
    "class Dataset():\n",
    "    def __init__(self, dataset_filename, max_batch_size, drop_sched_func=None, drop_prog_func=None, can_set_default_eval=None , speedups_clip_func=None):\n",
    "        \n",
    "        if dataset_filename.endswith('json'):\n",
    "            with open(dataset_filename, 'r') as f:\n",
    "                dataset_str= f.read()\n",
    "            self.programs_dict=json.loads(dataset_str)\n",
    "        elif dataset_filename.endswith('pkl'):\n",
    "            with open(dataset_filename, 'rb') as f:\n",
    "                self.programs_dict = pickle.load(f)\n",
    "        \n",
    "        self.batched_X = []\n",
    "        self.batched_Y = []\n",
    "        self.batches_dict=dict()\n",
    "        self.max_depth = 5 #WAS 5, LINA CHANGED IT FOR TESTING MISSING FUNCTIONS\n",
    "        self.nb_dropped = 0\n",
    "        self.pgme = 0\n",
    "        self.nb_pruned = 0\n",
    "        self.dropped_funcs = []\n",
    "        self.batched_datapoint_attributes = []\n",
    "        self.nb_datapoints = 0\n",
    "\n",
    "        if (drop_sched_func==None):\n",
    "            drop_sched_func = lambda x,y : False\n",
    "        if (drop_prog_func==None):\n",
    "            drop_prog_func = lambda x : False\n",
    "        if (speedups_clip_func==None):\n",
    "            speedups_clip_func = lambda x : x\n",
    "        if (can_set_default_eval==None):\n",
    "            can_set_default_eval = lambda x,y:0\n",
    "                \n",
    "        functions_list = list(self.programs_dict.keys())\n",
    "        random.Random(42).shuffle(functions_list)\n",
    "        for function_name in tqdm(functions_list):\n",
    "            if drop_prog_func(self.programs_dict[function_name]):\n",
    "                self.nb_dropped += len(self.programs_dict[function_name]['schedules_list'])\n",
    "                self.pgme += 1\n",
    "                self.dropped_funcs.append(function_name)\n",
    "                continue\n",
    "                \n",
    "            program_json = self.programs_dict[function_name]['program_annotation']\n",
    "            \n",
    "            try:\n",
    "                prog_tree, comps_repr_templates_list, loops_repr_templates_list, comps_placeholders_indices_dict, loops_placeholders_indices_dict = get_representation_template(self.programs_dict[function_name], max_depth = self.max_depth)\n",
    "            except (NbAccessException, LoopsDepthException):\n",
    "                self.nb_dropped += len(self.programs_dict[function_name]['schedules_list'])\n",
    "                self.pgme += 1\n",
    "                continue\n",
    "            program_exec_time = self.programs_dict[function_name]['initial_execution_time']\n",
    "            tree_footprint=get_tree_footprint(prog_tree)\n",
    "            self.batches_dict[tree_footprint] = self.batches_dict.get(tree_footprint,{'tree':prog_tree,'comps_tensor_list':[],'loops_tensor_list':[],'datapoint_attributes_list':[],'speedups_list':[],'exec_time_list':[]})\n",
    "            \n",
    "            for schedule_index in range(len(self.programs_dict[function_name]['schedules_list'])):\n",
    "                schedule_json = self.programs_dict[function_name]['schedules_list'][schedule_index]\n",
    "                sched_exec_time = np.min(schedule_json['execution_times'])\n",
    "                if drop_sched_func(self.programs_dict[function_name], schedule_index) or (not sched_exec_time):\n",
    "                    self.nb_dropped +=1\n",
    "                    self.nb_pruned +=1\n",
    "                    continue\n",
    "                \n",
    "                sched_speedup = program_exec_time / sched_exec_time\n",
    "                \n",
    "                def_sp = can_set_default_eval(self.programs_dict[function_name], schedule_index)\n",
    "                if def_sp>0:\n",
    "                    sched_speedup = def_sp\n",
    "                    \n",
    "                sched_speedup = speedups_clip_func(sched_speedup)\n",
    "\n",
    "                comps_tensor, loops_tensor = get_schedule_representation(program_json, schedule_json, comps_repr_templates_list, loops_repr_templates_list, comps_placeholders_indices_dict, loops_placeholders_indices_dict, self.max_depth)\n",
    "                \n",
    "                datapoint_attributes = get_datapoint_attributes(function_name, self.programs_dict[function_name], schedule_index, tree_footprint)\n",
    "                \n",
    "                self.batches_dict[tree_footprint]['comps_tensor_list'].append(comps_tensor)\n",
    "                self.batches_dict[tree_footprint]['loops_tensor_list'].append(loops_tensor)\n",
    "                self.batches_dict[tree_footprint]['datapoint_attributes_list'].append(datapoint_attributes)\n",
    "                self.batches_dict[tree_footprint]['speedups_list'].append(sched_speedup)\n",
    "                self.nb_datapoints+=1\n",
    "\n",
    "        storing_device = store_device\n",
    "        print('Batching ...', self.pgme)\n",
    "        for tree_footprint in tqdm(self.batches_dict):\n",
    "            \n",
    "            #shuffling the lists inside each footprint to avoid having batches with very low program diversity\n",
    "            zipped = list(zip(self.batches_dict[tree_footprint]['datapoint_attributes_list'],\n",
    "                              self.batches_dict[tree_footprint]['comps_tensor_list'],\n",
    "                              self.batches_dict[tree_footprint]['loops_tensor_list'],\n",
    "                              self.batches_dict[tree_footprint]['speedups_list']))\n",
    "            random.shuffle(zipped)\n",
    "            self.batches_dict[tree_footprint]['datapoint_attributes_list'],self.batches_dict[tree_footprint]['comps_tensor_list'],self.batches_dict[tree_footprint]['loops_tensor_list'],self.batches_dict[tree_footprint]['speedups_list']=zip(*zipped)\n",
    "            \n",
    "            for chunk in range(0,len(self.batches_dict[tree_footprint]['speedups_list']),max_batch_size):\n",
    "                if (storing_device.type=='cuda' and (torch.cuda.memory_allocated(storing_device.index)/torch.cuda.get_device_properties(storing_device.index).total_memory)>0.80):  # Check GPU memory in order to avoid Out of memory error\n",
    "                    print('GPU memory on '+str(storing_device)+' nearly full, switching to CPU memory')\n",
    "                    storing_device = torch.device('cpu')\n",
    "                self.batched_datapoint_attributes.append(self.batches_dict[tree_footprint]['datapoint_attributes_list'][chunk:chunk+max_batch_size])\n",
    "                self.batched_X.append((self.batches_dict[tree_footprint]['tree'],\n",
    "                               torch.cat(self.batches_dict[tree_footprint]['comps_tensor_list'][chunk:chunk+max_batch_size], 0).to(storing_device),\n",
    "                               torch.cat(self.batches_dict[tree_footprint]['loops_tensor_list'][chunk:chunk+max_batch_size], 0).to(storing_device)))\n",
    "                self.batched_Y.append(torch.FloatTensor(self.batches_dict[tree_footprint]['speedups_list'][chunk:chunk+max_batch_size]).to(storing_device))\n",
    "        \n",
    "        #shuffling batches to avoid having the same footprint in consecutive batches\n",
    "        zipped = list(zip(self.batched_X, self.batched_Y, self.batched_datapoint_attributes))\n",
    "        random.shuffle(zipped)\n",
    "        self.batched_X, self.batched_Y, self.batched_datapoint_attributes = zip(*zipped)\n",
    "        \n",
    "        print(f'Number of datapoints {self.nb_datapoints} Number of batches {len(self.batched_Y)}')\n",
    "#         del self.programs_dict\n",
    "        del self.batches_dict\n",
    "        \n",
    "    def __getitem__(self, index):\n",
    "        if isinstance(index, slice):\n",
    "            start, stop, step = index.indices(len(self))\n",
    "            return [self[i] for i in range(start, stop, step)]\n",
    "        elif isinstance(index, int):\n",
    "            return self.batched_X[index], self.batched_Y[index] \n",
    "\n",
    "    def __len__(self):\n",
    "        return len(self.batched_Y)\n",
    "\n",
    "\n",
    "# In[6]:\n",
    "\n",
    "\n",
    "def has_skippable_loop_1comp(prog_dict): # check if the program has a non time-step free iterator \n",
    "                                   # (has an iterator that is not used in accesses and the expression doesn't have reduction stentcils)\n",
    "    \n",
    "    program_json =  prog_dict['program_annotation']\n",
    "    if not len(program_json['computations'])==1: #this function works only on single comp programs\n",
    "        return False\n",
    "    comp_name = list(program_json['computations'].keys())[0]\n",
    "    comp_dict = program_json['computations'][comp_name]\n",
    "    write_buffer_id = comp_dict['write_buffer_id']\n",
    "    iterators = comp_dict['iterators']\n",
    "    write_dims =  isl_to_write_dims(comp_dict['write_access_relation'])\n",
    "    read_buffer_ids = [e['buffer_id'] for e in comp_dict['accesses']]\n",
    "    \n",
    "    \n",
    "    if len(write_dims)==len(iterators): # if all loops used in write, no free loops\n",
    "        # one special case of empty program\n",
    "        if len(read_buffer_ids) == 1 and read_buffer_ids[0]==write_buffer_id and comp_dict['number_of_additions'] ==0 and comp_dict['number_of_subtraction'] ==0 and comp_dict['number_of_multiplication'] ==0 and comp_dict['number_of_division'] ==0: \n",
    "            return True\n",
    "        return False\n",
    "    \n",
    "    if not write_buffer_id in read_buffer_ids: # if the calculation is clearly overwritten\n",
    "        return True\n",
    "    \n",
    "    # find the simle reduction access\n",
    "    found = False\n",
    "    for access in comp_dict['accesses']:\n",
    "        if access['buffer_id']==write_buffer_id and not access_is_stencil(access):\n",
    "            found = True\n",
    "            break\n",
    "    if not found: # no simple reduction access is found, but we know that there is a reduction access in expression, so there is a skippable loop if the reduction is performed on last iterator, otherwise it's hardly skippable\n",
    "        if write_dims[-1]!=iterators[-1]: # reduction is performed on the last iterator\n",
    "            return True\n",
    "    \n",
    "    # find the non simple reduction accesses\n",
    "    for access in comp_dict['accesses']:\n",
    "        if access['buffer_id']==write_buffer_id and access_is_stencil(access): # a stencil access pattern is used\n",
    "            return False\n",
    "    \n",
    "    # checking if there is a free loop (not used in write nor in read)\n",
    "    read_dims_bools = []\n",
    "    for access in comp_dict['accesses']: \n",
    "        read_dims_bools.append(np.any(access['access_matrix'], axis=0))\n",
    "    read_dims_bools = np.any(read_dims_bools,axis=0)\n",
    "    read_iterators = [iterators[i] for i, is_used in enumerate(read_dims_bools[:-1]) if is_used==True]\n",
    "    used_iterators = set(write_dims+read_iterators)\n",
    "    if len(used_iterators)==len(iterators): # all iterators are used in the computation\n",
    "        return False\n",
    "    \n",
    "    if iterators[-1] in used_iterators: # the last iterator is not the dropped one, so the dropped loop shouldn't be skippable (knowing that there is a reduction access)\n",
    "        if len(comp_dict['accesses'])>2:# has to have more than 2 accesses to make sure the loop isn't skippable, adding this condition for strictness\n",
    "            return False\n",
    "        \n",
    "    return True\n",
    "\n",
    "def sched_is_prunable_1comp(schedule_str, prog_depth):\n",
    "    if re.search('P\\(L2\\)U\\(L3,\\d+\\)', schedule_str):\n",
    "        return True\n",
    "    if prog_depth==2:\n",
    "        if re.search('P\\(L1\\)(?:[^T]|$)', schedule_str):\n",
    "            return True\n",
    "    if prog_depth==3:\n",
    "        if re.search('P\\(L2\\)(?:[^T]|$|T2\\(L0,L1)', schedule_str):\n",
    "            return True\n",
    "    return False\n",
    "\n",
    "def can_set_default_eval_1comp(schedule_str, prog_depth):\n",
    "    def_sp = 0\n",
    "#     print(schedule_str, type(schedule_str))\n",
    "    if prog_depth==2:\n",
    "        if re.search('P\\(L1\\)$', schedule_str):\n",
    "            def_sp = 0.001\n",
    "    if prog_depth==3:\n",
    "        if re.search('P\\(L2\\)$', schedule_str):\n",
    "            def_sp = 0.001\n",
    "    return def_sp\n",
    "def access_is_stencil(access):\n",
    "    return np.any(access['access_matrix'], axis=0)[-1]\n",
    "def linear_diophantine_default(f_i,f_j):\n",
    "    found = False\n",
    "    gamma = 0\n",
    "    sigma = 1\n",
    "    if ((f_j == 1) or (f_i == 1)):\n",
    "        gamma = f_i - 1\n",
    "        sigma = 1\n",
    "    else:\n",
    "        if((f_j == -1) and (f_i > 1)):\n",
    "            gamma = 1\n",
    "            sigma = 0       \n",
    "        else:     \n",
    "            i =0\n",
    "            while((i < 100) and (not found)):     \n",
    "                if (((sigma * f_i ) % abs(f_j)) ==  1):\n",
    "                            found = True\n",
    "                else:\n",
    "                    sigma+=1\n",
    "                    i+=1\n",
    "            if(not found):\n",
    "                print('Error cannof find solution to diophantine equation')\n",
    "                return\n",
    "            gamma = ((sigma * f_i) - 1 ) / f_j\n",
    "    \n",
    "    return gamma, sigma\n",
    "\n",
    "\n",
    "# In[7]:\n",
    "\n",
    "\n",
    "def wrongly_pruned_schedule(prog_dict, schedule_index):\n",
    "    schedule_dict = prog_dict['schedules_list'][schedule_index]\n",
    "    if not \"sched_str\" in schedule_dict: # this function concerns multicomp progs only, if sched str not in annot it means that the prog is single comp\n",
    "        return False \n",
    "    sched_str = schedule_dict[\"sched_str\"]\n",
    "#     if(schedule_dict[\"execution_times\"] == None):\n",
    "#         return True\n",
    "    target = prog_dict['initial_execution_time'] / np.min(schedule_dict[\"execution_times\"])\n",
    "    depths = []\n",
    "    for depth in prog_dict['program_annotation']['computations']:\n",
    "        depths.append(len(prog_dict['program_annotation']['computations'][depth]['iterators']))\n",
    "    if(not (target>0.0113 or target<0.0087)):\n",
    "        reg_str = \"\"\n",
    "        for j in reversed(range(len(depths))):\n",
    "            for i in range(depths[j]-1):\n",
    "                reg_str += \".*P\\(\\{(C[0-9],)*C\" + str(j) + \"(,C[0-9])*\\},L\"+ str(i) +\"\\)$|\"\n",
    "        reg_str= reg_str[:-1]\n",
    "        if(re.search(reg_str, sched_str)):\n",
    "#             if len(schedule_dict[\"execution_times\"])==1:\n",
    "            print(prog_dict['filename'][2:16], schedule_index, sched_str, len(schedule_dict[\"execution_times\"]),'yes')\n",
    "            \n",
    "#                             if not 'function760518'<prog_dict['filename'][2:16]<'function761289':\n",
    "#                 print(prog_dict['filename'][2:16], schedule_index, sched_str, len(schedule_dict[\"execution_times\"]),'are you sure?')\n",
    "#             else:\n",
    "#                 print(prog_dict['filename'][2:16], schedule_index, sched_str, len(schedule_dict[\"execution_times\"]),'yes')\n",
    "#             assert 'function760518'<prog_dict['filename'][2:16]<'function761289' #since we know that the ranges of programs affected by this bug, we can make this assertion\n",
    "            return True\n",
    "        else:\n",
    "            return False\n",
    "    else:\n",
    "        return False\n",
    "    \n",
    "    \n",
    "def encode_df_interchage(row, pred = True): #encode the output vector to get '1' in the right LI, '0' elsewhere\n",
    "    if pred == True:\n",
    "        str_sched = row[\"pred_str\"]\n",
    "    else:\n",
    "        str_sched = row[\"target_str\"]\n",
    "    output = np.zeros(106,dtype=int) # 106 = 2 C 15 + 1\n",
    "    str_interchange = re.findall('I\\(.*\\)', str_sched)  # get the LI string\n",
    "    if str_interchange==[]:\n",
    "        output[0] = 1\n",
    "    else:\n",
    "        m = re.findall(r'\\d+', str_interchange[0])  # get the number of the loops\n",
    "        a = min(int(m[-2]),int(m[-1]))\n",
    "        b = max(int(m[-2]),int(m[-1]))\n",
    "        i2 = b-a\n",
    "        i1 = pos(a,15)\n",
    "        output[i1+i2]=1      \n",
    "    return output\n",
    "\n",
    "def exist_merged(row, names_merged): #encode the output vector to get '1' in the right LI, '0' elsewhere\n",
    "    return (row[\"name\"] in names_merged)\n",
    "\n",
    "def pos(a,depth):  # calculate the position of the interchange in the output vector\n",
    "    if(a==0):\n",
    "        return 0\n",
    "    elif (a==1):\n",
    "        return depth-1\n",
    "    else:\n",
    "        return pos(a-1,depth)+depth-a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Functions for LI k-best specialized model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_representation_LI(program_json, schedule_json):\n",
    "    max_dims= 8\n",
    "    max_accesses = 15 # TODO: check if 10 is enough\n",
    "    program_representation = []\n",
    "    indices_dict = dict()\n",
    "    computations_dict = program_json['computations']\n",
    "    ordered_comp_list = sorted(list(computations_dict.keys()), key = lambda x: computations_dict[x]['absolute_order'])\n",
    "    \n",
    "    for index, comp_name in enumerate(ordered_comp_list):\n",
    "        comp_dict = computations_dict[comp_name]\n",
    "        if len(comp_dict['accesses'])>max_accesses:\n",
    "#             print('too much acc')\n",
    "            raise LargeAccessMatices\n",
    "        if len(comp_dict['accesses'])<1:\n",
    "#             print('too little acc')\n",
    "            raise LargeAccessMatices\n",
    "        comp_representation = []\n",
    "        #         Is this computation a reduction \n",
    "        comp_representation.append(+comp_dict['comp_is_reduction'])\n",
    "\n",
    "\n",
    "#         iterators representation + tiling and interchage\n",
    "        iterators_repr = []\n",
    "        for iterator_name in comp_dict['iterators']:\n",
    "            \n",
    "            iterator_dict = program_json['iterators'][iterator_name]\n",
    "            iterators_repr.append(iterator_dict['upper_bound']) \n",
    "#             iterators_repr.append(iterator_dict['lower_bound'])\n",
    "            # unfuse schedule replacing the lower bound for compability issue, this enables the use transfer learning from an older model \n",
    "            parent_iterator = program_json['iterators'][iterator_name]['parent_iterator']\n",
    "            \n",
    "            # changed bcs it cause an error, to verify  ( as well as line 228) !!!!!!\n",
    "            #if parent_iterator in schedule_json['unfuse_iterators']:\n",
    "                #iterators_repr.append(1) #unfused true\n",
    "            #else:\n",
    "                #iterators_repr.append(0) #unfused false\n",
    "            \n",
    "            \n",
    "            if iterator_name in schedule_json[comp_name]['interchange_dims']:\n",
    "                iterators_repr.append(1) #interchanged true\n",
    "            else:\n",
    "                iterators_repr.append(0) #interchanged false\n",
    "            \n",
    "            # Skewing representation\n",
    "            skewed = 0\n",
    "            skew_factor = 0\n",
    "            skew_extent = 0\n",
    "            if schedule_json[comp_name]['skewing'] and (iterator_name in schedule_json[comp_name]['skewing']['skewed_dims']):\n",
    "                skewed = 1 #skewed: true\n",
    "                skew_factor_index = schedule_json[comp_name]['skewing']['skewed_dims'].index(iterator_name)\n",
    "                skew_factor = int(schedule_json[comp_name]['skewing']['skewing_factors'][skew_factor_index]) # skew factor\n",
    "                skew_extent = int(schedule_json[comp_name]['skewing']['average_skewed_extents'][skew_factor_index]) # skew extent\n",
    "            iterators_repr.append(skewed)\n",
    "            iterators_repr.append(skew_factor)\n",
    "            iterators_repr.append(skew_extent)\n",
    "            \n",
    "             # Parallelization representation\n",
    "            parallelized = 0\n",
    "            if iterator_name == schedule_json[comp_name]['parallelized_dim']:\n",
    "                parallelized = 1 # parallelized true\n",
    "            iterators_repr.append(parallelized)\n",
    "            \n",
    "            if (schedule_json[comp_name]['tiling']!={}):\n",
    "                if iterator_name in schedule_json[comp_name]['tiling']['tiling_dims']:\n",
    "                    iterators_repr.append(1) #tiled: true\n",
    "                    tile_factor_index = schedule_json[comp_name]['tiling']['tiling_dims'].index(iterator_name)\n",
    "                    iterators_repr.append(int(schedule_json[comp_name]['tiling']['tiling_factors'][tile_factor_index])) #tile factor\n",
    "                else:\n",
    "                    iterators_repr.append(0) #tiled: false\n",
    "                    iterators_repr.append(0) #tile factor 0\n",
    "            else: #tiling = None\n",
    "                iterators_repr.append(0) #tiled: false\n",
    "                iterators_repr.append(0) #tile factor 0    \n",
    "            # is this dimension saved (this dimension does not disapear aftre reduction)\n",
    "#             iterators_repr.append(+(iterator_name in comp_dict['real_dimensions']))\n",
    "                    \n",
    "        iterator_repr_size = int(len(iterators_repr)/len(comp_dict['iterators']))\n",
    "        iterators_repr.extend([0]*iterator_repr_size*(max_dims-len(comp_dict['iterators']))) # adding iterators padding \n",
    "\n",
    "        comp_representation.extend(iterators_repr) #adding the iterators representation    \n",
    "\n",
    "        #       write access represation \n",
    "        write_access_matrix = isl_to_write_matrix(comp_dict['write_access_relation'])\n",
    "        write_access_matrix = np.array(write_access_matrix)\n",
    "        write_access_matrix = np.c_[np.ones(write_access_matrix.shape[0]), write_access_matrix] # adding tags for marking the used rows\n",
    "        write_access_matrix = np.r_[[np.ones(write_access_matrix.shape[1])], write_access_matrix] # adding tags for marking the used columns\n",
    "        padded_write_matrix = np.zeros((max_dims + 1, max_dims + 2))\n",
    "        padded_write_matrix[:write_access_matrix.shape[0],:write_access_matrix.shape[1]-1] = write_access_matrix[:,:-1] #adding padding to the access matrix\n",
    "        padded_write_matrix[:write_access_matrix.shape[0],-1] = write_access_matrix[:,-1] #adding padding to the access matrix\n",
    "        write_access_repr = [comp_dict['write_buffer_id']+1] + padded_write_matrix.flatten().tolist()\n",
    "        comp_representation.extend(write_access_repr)\n",
    "        \n",
    "#         accesses representation\n",
    "        accesses_repr=[]\n",
    "        for access_dict in comp_dict['accesses']:\n",
    "            access_matrix = access_dict['access_matrix']\n",
    "            access_matrix = np.array(access_matrix)\n",
    "            padded_access_matrix = np.zeros((max_dims, max_dims + 1))\n",
    "            padded_access_matrix[:access_matrix.shape[0],:access_matrix.shape[1]-1] = access_matrix[:,:-1] #adding padding to the access matrix\n",
    "            padded_access_matrix[:access_matrix.shape[0],-1] = access_matrix[:,-1] #adding padding to the access matrix\n",
    "            access_repr = [access_dict['buffer_id']] + padded_access_matrix.flatten().tolist() # input_id + flattened access matrix \n",
    "            # is this access a reduction (the computation is accesing itself)\n",
    "            access_repr.append(+access_dict['access_is_reduction'])\n",
    "            accesses_repr.extend(access_repr)\n",
    "\n",
    "        #access_repr_len = max_dims*(max_dims + 1)\n",
    "        access_repr_len = max_dims*(max_dims + 1) + 1 +1 #+1 for input id, +1 for is_access_reduction\n",
    "        accesses_repr.extend([0]*access_repr_len*(max_accesses-len(comp_dict['accesses']))) #adding accesses padding\n",
    "    \n",
    "        comp_representation.extend(accesses_repr) #adding access representation\n",
    "\n",
    "#         operation histogram\n",
    "        comp_representation.append(comp_dict['number_of_additions'])\n",
    "        comp_representation.append(comp_dict['number_of_subtraction'])\n",
    "        comp_representation.append(comp_dict['number_of_multiplication'])\n",
    "        comp_representation.append(comp_dict['number_of_division'])\n",
    "\n",
    "        \n",
    "#         unrolling representation\n",
    "        if (schedule_json[comp_name]['unrolling_factor']!=None):\n",
    "            comp_representation.append(1) #unrolled True\n",
    "            comp_representation.append(int(schedule_json[comp_name]['unrolling_factor'])) #unroll factor\n",
    "        else:\n",
    "            comp_representation.append(0) #unrolled false\n",
    "            comp_representation.append(0) #unroll factor 0\n",
    "\n",
    "        # adding log(x+1) of the representation\n",
    "#         log_rep = list(np.log1p(comp_representation))\n",
    "#         comp_representation.extend(log_rep)\n",
    "        \n",
    "        program_representation.append(comp_representation)\n",
    "        indices_dict[comp_name] = index\n",
    "    \n",
    "    # transforming the schedule_json inorder to have loops as key instead of computations, this dict helps building the loop vectors\n",
    "    loop_schedules_dict = dict()\n",
    "    for loop_name in program_json['iterators']:\n",
    "        loop_schedules_dict[loop_name]=dict()\n",
    "        loop_schedules_dict[loop_name]['interchanged']=False\n",
    "        loop_schedules_dict[loop_name]['interchanged_with']=None\n",
    "        loop_schedules_dict[loop_name]['skewed']=False\n",
    "        loop_schedules_dict[loop_name]['skewed_dims']=None\n",
    "        loop_schedules_dict[loop_name]['skew_factor']=None\n",
    "        loop_schedules_dict[loop_name]['skew_extent']=None\n",
    "        loop_schedules_dict[loop_name]['parallelized']=False\n",
    "        loop_schedules_dict[loop_name]['tiled']=False\n",
    "        loop_schedules_dict[loop_name]['tile_depth']=None\n",
    "        loop_schedules_dict[loop_name]['tiled_dims']=None\n",
    "        loop_schedules_dict[loop_name]['tile_factor']=None\n",
    "        loop_schedules_dict[loop_name]['unrolled']=False\n",
    "        loop_schedules_dict[loop_name]['unroll_factor']=None\n",
    "        loop_schedules_dict[loop_name]['unroll_comp']=None\n",
    "        loop_schedules_dict[loop_name]['unfused']=False     \n",
    "    for comp_name in schedule_json:\n",
    "        if not comp_name.startswith('comp'): \n",
    "            continue # skip the non computation keys\n",
    "        if schedule_json[comp_name]['interchange_dims']!=[]:\n",
    "            interchanged_loop1=schedule_json[comp_name]['interchange_dims'][0]\n",
    "            interchanged_loop2=schedule_json[comp_name]['interchange_dims'][1]\n",
    "            loop_schedules_dict[interchanged_loop1]['interchanged']=True\n",
    "            loop_schedules_dict[interchanged_loop1]['interchanged_with']=interchanged_loop2\n",
    "            loop_schedules_dict[interchanged_loop2]['interchanged']=True\n",
    "            loop_schedules_dict[interchanged_loop2]['interchanged_with']=interchanged_loop1\n",
    "        if schedule_json[comp_name]['skewing']:\n",
    "            for skewed_loop_index,skewed_loop in enumerate(schedule_json[comp_name]['skewing']['skewed_dims']):\n",
    "                loop_schedules_dict[skewed_loop]['skewed']=True\n",
    "                loop_schedules_dict[skewed_loop]['skew_factor'] = int(schedule_json[comp_name]['skewing']['skewing_factors'][skewed_loop_index])\n",
    "                loop_schedules_dict[skewed_loop]['skew_extent'] = int(schedule_json[comp_name]['skewing']['average_skewed_extents'][skewed_loop_index])\n",
    "        if schedule_json[comp_name]['parallelized_dim']:\n",
    "             loop_schedules_dict[schedule_json[comp_name]['parallelized_dim']]['parallelized']=True\n",
    "        if schedule_json[comp_name]['tiling']!={}:\n",
    "            for tiled_loop_index,tiled_loop in enumerate(schedule_json[comp_name]['tiling']['tiling_dims']):\n",
    "                loop_schedules_dict[tiled_loop]['tiled']=True\n",
    "                loop_schedules_dict[tiled_loop]['tile_depth']=schedule_json[comp_name]['tiling']['tiling_depth']\n",
    "                loop_schedules_dict[tiled_loop]['tiled_dims']=schedule_json[comp_name]['tiling']['tiling_dims']\n",
    "                loop_schedules_dict[tiled_loop]['tile_factor']=int(schedule_json[comp_name]['tiling']['tiling_factors'][tiled_loop_index])\n",
    "        if schedule_json[comp_name]['unrolling_factor']!=None:\n",
    "            comp_innermost_loop=computations_dict[comp_name]['iterators'][-1] \n",
    "            tiling_dims = [] if schedule_json[comp_name]['tiling']=={} else schedule_json[comp_name]['tiling']['tiling_dims']\n",
    "            interchange_dims =schedule_json[comp_name]['interchange_dims']\n",
    "            if (not ((comp_innermost_loop in tiling_dims)or(comp_innermost_loop in interchange_dims))):#unrolling always applied to innermost loop, if tilling or interchange is applied to innermost, unroll is applied to the resulting loop instead of the orginal, hence we don't represent it\n",
    "                loop_schedules_dict[comp_innermost_loop]['unrolled']=True\n",
    "                loop_schedules_dict[comp_innermost_loop]['unroll_factor']=int(schedule_json[comp_name]['unrolling_factor'])\n",
    "                loop_schedules_dict[comp_innermost_loop]['unroll_comp']=comp_name\n",
    "    \n",
    "    #for unfuse_parent in schedule_json['unfuse_iterators'] :\n",
    "        #for unfused_loop in program_json['iterators'][unfuse_parent]['child_iterators']:\n",
    "            #loop_schedules_dict[unfused_loop]['unfused']=True\n",
    "    \n",
    "    # collect the set of iterators that are used for computation (to eleminate those that are only used for inputs)\n",
    "    real_loops = set()\n",
    "    for comp_name in computations_dict:\n",
    "        real_loops.update(computations_dict[comp_name]['iterators'])\n",
    "        \n",
    "    #building loop tensor\n",
    "    loops_representation_list = []\n",
    "    loops_indices_dict = dict()\n",
    "    loop_index=0\n",
    "    for loop_name in program_json['iterators']:\n",
    "        if not (loop_name in real_loops): # this removes the iterators that are only used for decraling inputs\n",
    "            continue\n",
    "        loop_representation=[]\n",
    "        loop_dict = program_json['iterators'][loop_name]\n",
    "        # upper and lower bound\n",
    "        loop_representation.append(loop_dict['upper_bound'])\n",
    "        loop_representation.append(loop_dict['lower_bound'])\n",
    "        if loop_schedules_dict[loop_name]['unfused']:\n",
    "            loop_representation.append(1) #unfused True\n",
    "        else:\n",
    "            loop_representation.append(0) #unfused False\n",
    "        if loop_schedules_dict[loop_name]['interchanged']:\n",
    "            loop_representation.append(1) #interchanged True\n",
    "        else:\n",
    "            loop_representation.append(0) #interchanged False     \n",
    "        if loop_schedules_dict[loop_name]['skewed']:\n",
    "            loop_representation.append(1) #skewed True\n",
    "            loop_representation.append(loop_schedules_dict[loop_name]['skew_factor']) #skew factor\n",
    "            loop_representation.append(loop_schedules_dict[loop_name]['skew_extent']) #skew extent\n",
    "        else:\n",
    "            loop_representation.append(0) # skewed false\n",
    "            loop_representation.append(0) # factor\n",
    "            loop_representation.append(0) # extent\n",
    "        if loop_schedules_dict[loop_name]['parallelized']:\n",
    "            loop_representation.append(1) #parallelized True\n",
    "        else:\n",
    "            loop_representation.append(0) # parallelized false\n",
    "        if loop_schedules_dict[loop_name]['tiled']:\n",
    "            loop_representation.append(1) #tiled True\n",
    "            loop_representation.append(loop_schedules_dict[loop_name]['tile_factor']) #tile factor\n",
    "        else:\n",
    "            loop_representation.append(0) #tiled False\n",
    "            loop_representation.append(0) #tile factor 0\n",
    "        # TODO: check if unroll representation should be moved to comp vector instead of loop vector\n",
    "        if loop_schedules_dict[loop_name]['unrolled']:\n",
    "            loop_representation.append(1) #unrolled True\n",
    "            loop_representation.append(loop_schedules_dict[loop_name]['unroll_factor']) #unroll factor\n",
    "        else:\n",
    "            loop_representation.append(0) #unrolled False\n",
    "            loop_representation.append(0) #unroll factor 0\n",
    "        # adding log(x+1) of the loop representation\n",
    "        loop_log_rep = list(np.log1p(loop_representation))\n",
    "        loop_representation.extend(loop_log_rep)\n",
    "        loops_representation_list.append(loop_representation)    \n",
    "        loops_indices_dict[loop_name]=loop_index\n",
    "        loop_index+=1\n",
    "            \n",
    "     \n",
    "    def update_tree_atributes(node):     \n",
    "        node['loop_index'] = torch.tensor(loops_indices_dict[node['loop_name'][:3]]).to(train_device)\n",
    "        if node['computations_list']!=[]:\n",
    "            node['computations_indices'] = torch.tensor([indices_dict[comp_name] for comp_name in node['computations_list']]).to(train_device)\n",
    "            node['has_comps'] = True\n",
    "        else:\n",
    "            node['has_comps'] = False\n",
    "        for child_node in node['child_list']:\n",
    "            update_tree_atributes(child_node)\n",
    "        return node\n",
    "    \n",
    "    tree_annotation = copy.deepcopy(schedule_json['tree_structure']) #to avoid altering the original tree from the json\n",
    "    prog_tree = update_tree_atributes(tree_annotation) \n",
    "    \n",
    "    loops_tensor = torch.unsqueeze(torch.FloatTensor(loops_representation_list),0)#.to(device)\n",
    "    computations_tensor = torch.unsqueeze(torch.FloatTensor(program_representation),0)#.to(device)     \n",
    "\n",
    "    return prog_tree, computations_tensor, loops_tensor\n",
    "\n",
    "\n",
    "#################################################\n",
    "\n",
    "# def get_tree_footprint(tree):\n",
    "#     footprint='<BL'+str(int(tree['loop_index']))\n",
    "#     if tree['has_comps']:\n",
    "#         footprint+='['\n",
    "#         for idx in tree['computations_indices']:\n",
    "#             footprint+='CI'+str(int(idx))\n",
    "#         footprint+=']'\n",
    "#     for child in tree['child_list']:\n",
    "#         footprint+= get_tree_footprint(child)\n",
    "#     footprint+='EL'+str(int(tree['loop_index']))+'>'\n",
    "#     return footprint\n",
    "    \n",
    "class Dataset_LI():\n",
    "    def __init__(self, dataset_MC_filename, dataset_SC_filename, max_batch_size, filter_func=None, filter_func_MC=None,filter_func_SC=None, transform_func=None):\n",
    "        super().__init__()\n",
    "        \n",
    "        self.X = []\n",
    "        self.Y = []\n",
    "        self.batched_program_names = []\n",
    "        self.batched_schedule_names = []\n",
    "        self.batched_exec_time = []\n",
    "        self.nb_nan=0\n",
    "        self.nb_long_access=0\n",
    "        self.batches_dict=dict()\n",
    "            \n",
    "        \n",
    "        if(dataset_MC_filename!=None):\n",
    "        \n",
    "            #loading multi computation programs\n",
    "\n",
    "            self.dataset_MC_name=dataset_MC_filename\n",
    "\n",
    "            if dataset_MC_filename.endswith('json'):\n",
    "                with open(dataset_MC_filename, 'r') as f:\n",
    "                    dataset_MC_str = f.read()\n",
    "                self.programs_dict_MC = json.loads(dataset_MC_str)\n",
    "            elif dataset_MC_filename.endswith('pkl'):\n",
    "                with open(dataset_MC_filename, 'rb') as f:\n",
    "                    self.programs_dict_MC = pickle.load(f)\n",
    "\n",
    "            if (filter_func_MC==None):\n",
    "                filter_func_MC = lambda x : True\n",
    "            if (transform_func==None):\n",
    "                transform_func = lambda x : x\n",
    "\n",
    "\n",
    "            for function_name in tqdm(self.programs_dict_MC):\n",
    "#                 print(\"MC : \", function_name)\n",
    "                if (np.min(self.programs_dict_MC[function_name]['schedules_list'][0]['execution_times'])<0): #if less than x ms\n",
    "                    continue\n",
    "\n",
    "                program_json = self.programs_dict_MC[function_name]['program_annotation']\n",
    "                program_exec_time = self.programs_dict_MC[function_name]['initial_execution_time']\n",
    "                loops = shared_loop_nest(program_json)\n",
    "\n",
    "                schedules_dict = {}   #####\n",
    "                explored_schedules = {}\n",
    "\n",
    "                for schedule_index in range(len(self.programs_dict_MC[function_name]['schedules_list'])):\n",
    "                    sched_str = self.programs_dict_MC[function_name]['schedules_list'][schedule_index][\"sched_str\"]\n",
    "                    schedule_json = self.programs_dict_MC[function_name]['schedules_list'][schedule_index]\n",
    "\n",
    "                    if (not filter_func_MC(sched_str)) or (not legal_LI(sched_str, schedule_index, loops)):\n",
    "                        continue\n",
    "\n",
    "                    sched_exec_time = np.min(schedule_json['execution_times'])\n",
    "                    self.programs_dict_MC[function_name]['schedules_list'][schedule_index]['speedup'] = max(program_exec_time / sched_exec_time,0.01) #speedup clipping\n",
    "                    if ((np.isnan(self.programs_dict_MC[function_name]['schedules_list'][schedule_index]['speedup']))\n",
    "                         or(self.programs_dict_MC[function_name]['schedules_list'][schedule_index]['speedup']==0)): #Nan value means the schedule didn't run, zero values means exec time<1 micro-second, skip them\n",
    "                        self.nb_nan+=1\n",
    "                        continue\n",
    "\n",
    "\n",
    "                    #look for the parent schedule\n",
    "                    scheduleP_str = re.sub(\"I\\(\\{[C0-9,]+\\},L[0-9]+,L[0-9]+\\)\", '', sched_str)\n",
    "#                     print(scheduleP_str, sched_str)\n",
    "                    if scheduleP_str in explored_schedules.keys():  #parent schedule exist, check if this is better\n",
    "                        schedulePID = explored_schedules[scheduleP_str]\n",
    "            \n",
    "                        #for k best\n",
    "                        ind_LI = index_interchage(sched_str, len(program_json['iterators']))\n",
    "                        if sched_exec_time < schedules_dict[schedulePID]['all'][ind_LI]:\n",
    "                            schedules_dict[schedulePID]['all'][ind_LI] = sched_exec_time\n",
    "                    \n",
    "                        if sched_exec_time >= schedules_dict[schedulePID]['best']: # not the best\n",
    "                            continue\n",
    "                        else :\n",
    "                            schedules_dict[schedulePID]['best'] = sched_exec_time\n",
    "                            schedules_dict[schedulePID]['sched'] = schedule_index\n",
    "#                             sched_dict = {'best':sched_exec_time, 'sched':schedule_index}\n",
    "#                             schedules_dict[schedulePID] = sched_dict\n",
    "                        \n",
    "\n",
    "                    else: # parent schedule is new \n",
    "                        scheduleP, schedulePID = get_sched_by_string(scheduleP_str, self.programs_dict_MC[function_name]['schedules_list'])\n",
    "#                         print(scheduleP, schedulePID )\n",
    "                        explored_schedules[scheduleP_str]=schedulePID  # discoverd a new schedule\n",
    "\n",
    "                        schedP_exec_time = np.min(scheduleP['execution_times'])\n",
    "\n",
    "                        if sched_exec_time >= schedP_exec_time: # parent is best\n",
    "                            schedP_dict = {'best':schedP_exec_time, 'sched':schedulePID}\n",
    "                            schedules_dict[schedulePID] = schedP_dict\n",
    "                        else : # schedule is best\n",
    "                            sched_dict = {'best':sched_exec_time, 'sched':schedule_index}\n",
    "                            schedules_dict[schedulePID] = sched_dict\n",
    "                        \n",
    "                        #for k_best\n",
    "                        output = np.zeros(106,dtype=np.float64) + np.inf # because, a priori, all of them are very bad and does not execute well\n",
    "                        output[0] = schedP_exec_time\n",
    "                        ind_LI = index_interchage(sched_str, len(program_json['iterators']))\n",
    "                        output[ind_LI] = sched_exec_time\n",
    "                        schedules_dict[schedulePID]['all'] = output\n",
    "\n",
    "\n",
    "                #for each fused program or the original pgme\n",
    "                for elem in schedules_dict.items():\n",
    "                    sched_json = self.programs_dict_MC[function_name]['schedules_list'][elem[0]]\n",
    "                    try:\n",
    "                        tree, comps_tensor, loops_tensor = get_representation_LI(program_json, sched_json) ######\n",
    "                    except LargeAccessMatices:\n",
    "                        self.nb_long_access +=1\n",
    "                        continue   \n",
    "\n",
    "                    # for each datapoint append its best LI\n",
    "\n",
    "                    tree_footprint=get_tree_footprint(tree) \n",
    "                    self.batches_dict[tree_footprint] = self.batches_dict.get(tree_footprint,{'tree':tree,'comps_tensor_list':[],'loops_tensor_list':[],'program_names_list':[],'sched_names_list':[],'speedups_list':[],'exec_time_list':[], 'output':[]}) \n",
    "                    self.batches_dict[tree_footprint]['comps_tensor_list'].append(comps_tensor)\n",
    "                    self.batches_dict[tree_footprint]['loops_tensor_list'].append(loops_tensor)\n",
    "                    self.batches_dict[tree_footprint]['sched_names_list'].append(elem[0])\n",
    "                    self.batches_dict[tree_footprint]['program_names_list'].append(function_name)\n",
    "\n",
    "                    speedup = max(program_exec_time / elem[1]['best'] , 0.01) #speedup clipping\n",
    "                    self.batches_dict[tree_footprint]['speedups_list'].append(speedup)  \n",
    "                    self.batches_dict[tree_footprint]['exec_time_list'].append(elem[1]['best'])\n",
    "\n",
    "                    best_schedule_str = self.programs_dict_MC[function_name]['schedules_list'][elem[1]['sched']]['sched_str'] #does it contains only LI ?\n",
    "                    \n",
    "                    #Y\n",
    "                    output= elem[1]['all']\n",
    "                    output = output[0] / output \n",
    "        #             print(\"-----------------\")\n",
    "        #             print(output)\n",
    "                    order = np.flip(np.argsort(output, -1)) #highest to smallest\n",
    "        #             print(order)\n",
    "                    y = np.zeros(106 * k,dtype=np.float64)\n",
    "                    for i in range(k):\n",
    "                        if output[order[i]] == 0:\n",
    "                            y[106*i] = 1 # No LI\n",
    "                            continue\n",
    "                        y[106*i+order[i]] = 1 #define the output, using the best order we have in order % speedups. Because,it returns the indexes of the best options, and thus, the ones that should be put in 1.\n",
    "\n",
    "                    self.batches_dict[tree_footprint]['output'].append(torch.tensor(y)) \n",
    "\n",
    "     \n",
    "        #loading single computation programs\n",
    "        if(dataset_SC_filename!=None):\n",
    "            self.dataset_SC_name=dataset_SC_filename\n",
    "\n",
    "            if dataset_SC_filename.endswith('json'):\n",
    "                with open(dataset_SC_filename, 'r') as f:\n",
    "                    dataset_SC_str = f.read()\n",
    "                self.programs_dict_SC = json.loads(dataset_SC_str)\n",
    "            elif dataset_SC_filename.endswith('pkl'):\n",
    "                with open(dataset_SC_filename, 'rb') as f:\n",
    "                    self.programs_dict_SC = pickle.load(f)\n",
    "\n",
    "            if (filter_func_SC==None):\n",
    "                filter_func_SC = lambda x : True\n",
    "            if (transform_func==None):\n",
    "                transform_func = lambda x : x\n",
    "\n",
    "\n",
    "            for function_name in tqdm(self.programs_dict_SC):\n",
    "                if (np.min(self.programs_dict_SC[function_name]['schedules_list'][0]['execution_times'])<0): #if less than x ms\n",
    "                    continue\n",
    "                program_json = self.programs_dict_SC[function_name]['program_annotation']\n",
    "                program_exec_time = self.programs_dict_SC[function_name]['initial_execution_time']\n",
    "                Parent_sched_json = self.programs_dict_SC[function_name]['schedules_list'][0]   # get the parent schedule\n",
    "\n",
    "\n",
    "                try:\n",
    "                    tree, comps_tensor, loops_tensor = get_representation_LI(program_json, Parent_sched_json) ######\n",
    "                except LargeAccessMatices:\n",
    "                    self.nb_long_access +=1\n",
    "                    continue        \n",
    "\n",
    "                #######\n",
    "                min_sch_time = np.inf   \n",
    "                output = np.zeros(106,dtype=np.float64) + np.inf # because, a priori, all of them are very bad and does not execute well\n",
    "                \n",
    "                for schedule_index in range(len(self.programs_dict_SC[function_name]['schedules_list'])):\n",
    "                    sched_str = sched_json_to_sched_str( self.programs_dict_SC[function_name]['schedules_list'][schedule_index] )\n",
    "                    if (not filter_func_SC(sched_str)):\n",
    "                        continue  \n",
    "\n",
    "                    sched_exec_time = np.min(self.programs_dict_SC[function_name]['schedules_list'][schedule_index]['execution_times'])\n",
    "                    self.programs_dict_SC[function_name]['schedules_list'][schedule_index]['speedup'] = max(program_exec_time / sched_exec_time,0.01) #speedup clipping\n",
    "                    if ((np.isnan(self.programs_dict_SC[function_name]['schedules_list'][schedule_index]['speedup']))\n",
    "                         or(self.programs_dict_SC[function_name]['schedules_list'][schedule_index]['speedup']==0)): #Nan value means the schedule didn't run, zero values means exec time<1 micro-second, skip them\n",
    "                        self.nb_nan+=1\n",
    "                        continue\n",
    "\n",
    "                    #if another schedule used the same interchange before\n",
    "                    if output[index_interchage(sched_str,15)] > sched_exec_time:\n",
    "                        output[index_interchage(sched_str,15)] = sched_exec_time #position all the execution times\n",
    "                \n",
    "                    if sched_exec_time >= min_sch_time:\n",
    "                            continue   # we only keep the best loop interchange for a given program\n",
    "                    min_sch_time = sched_exec_time\n",
    "                    #best_schedule_str = self.programs_dict_SC[function_name]['schedules_list'][schedule_index]['sched_str']\n",
    "                    best_schedule_str = sched_json_to_sched_str( self.programs_dict_SC[function_name]['schedules_list'][schedule_index] )\n",
    "               ########\n",
    "                \n",
    "            \n",
    "                # for each function append its best LI\n",
    "\n",
    "                tree_footprint=get_tree_footprint(tree) \n",
    "                self.batches_dict[tree_footprint] = self.batches_dict.get(tree_footprint,{'tree':tree,'comps_tensor_list':[],'loops_tensor_list':[],'program_names_list':[],'sched_names_list':[],'speedups_list':[],'exec_time_list':[], 'output':[]}) \n",
    "                self.batches_dict[tree_footprint]['comps_tensor_list'].append(comps_tensor)\n",
    "                self.batches_dict[tree_footprint]['loops_tensor_list'].append(loops_tensor)\n",
    "                #self.batches_dict[tree_footprint]['sched_names_list'].append(schedule_name)  ommit it bcs the schedule is always the 0th schedule ==> not significant\n",
    "                self.batches_dict[tree_footprint]['program_names_list'].append(function_name)\n",
    "                self.batches_dict[tree_footprint]['speedups_list'].append(self.programs_dict_SC[function_name]['schedules_list'][0]['speedup'])  ######\n",
    "                self.batches_dict[tree_footprint]['exec_time_list'].append(program_exec_time)   ######\n",
    "                \n",
    "                #Y\n",
    "                output = output[0] / output \n",
    "                order = np.flip(np.argsort(output, -1)) #highest to smallest\n",
    "                y = np.zeros(106 * k,dtype=np.float64)\n",
    "                for i in range(k):\n",
    "                    if output[order[i]] == 0:\n",
    "                        y[106*i] = 1 # No LI\n",
    "                        continue\n",
    "                    y[106*i+order[i]] = 1 #define the output, using the best order we have in order % speedups. Because,it returns the indexes of the best options, and thus, the ones that should be put in 1.\n",
    "\n",
    "                self.batches_dict[tree_footprint]['output'].append(torch.tensor(y))\n",
    "\n",
    "        \n",
    " \n",
    "        storing_device = store_device\n",
    "        for tree_footprint in self.batches_dict:\n",
    "            for chunk in range(0,len(self.batches_dict[tree_footprint]['program_names_list']),max_batch_size):  #####\n",
    "                if storing_device.type=='cuda': # Check GPU memory in order to avoid Out of memory error\n",
    "                    if ((torch.cuda.memory_allocated(storing_device.index)/torch.cuda.get_device_properties(storing_device.index).total_memory)>0.80):\n",
    "                        print('GPU memory on '+str(storing_device)+' nearly full, switching to CPU memory')\n",
    "                        storing_device = torch.device('cpu')\n",
    "                #self.batched_schedule_names.append(self.batches_dict[tree_footprint]['sched_names_list'][chunk:chunk+max_batch_size])   #####\n",
    "                self.batched_program_names.append(self.batches_dict[tree_footprint]['program_names_list'][chunk:chunk+max_batch_size])\n",
    "                self.batched_exec_time.append(self.batches_dict[tree_footprint]['exec_time_list'][chunk:chunk+max_batch_size])\n",
    "                self.X.append( ( self.batches_dict[tree_footprint]['tree'],\n",
    "                               torch.cat(self.batches_dict[tree_footprint]['comps_tensor_list'][chunk:chunk+max_batch_size], 0).to(storing_device),\n",
    "                               torch.cat(self.batches_dict[tree_footprint]['loops_tensor_list'][chunk:chunk+max_batch_size], 0).to(storing_device) ) )\n",
    "                \n",
    "                temp_tens = torch.cat(self.batches_dict[tree_footprint]['output'][chunk:chunk+max_batch_size],0)\n",
    "                dim_temp_tens = int(temp_tens.shape[0] / (106 * 5))\n",
    "#                 print(temp_tens.shape)\n",
    "                self.Y.append(torch.reshape(temp_tens, (dim_temp_tens,106 *5)).to(storing_device)) ###### was (dim_temp_tens,1,106))\n",
    "                \n",
    "                if len(self.X) != len(self.Y):\n",
    "                    print(len(self.X[-1]), len(self.Y[-1]))   # to look here \n",
    "                    print(type(self.X),len(self.X), type(self.Y),len(self.Y),type(self.X[0][1]),len(self.X[0][1]))\n",
    "                    print(\"stop\")\n",
    "                                                \n",
    "        print(f'Number of batches {len(self.Y)}')\n",
    "        if self.nb_long_access>0:\n",
    "            print('Number of batches dropped due to too much memory accesses:' +str(self.nb_long_access))\n",
    "            \n",
    "            \n",
    "    def __getitem__(self, index):\n",
    "        if isinstance(index, slice):\n",
    "            start, stop, step = index.indices(len(self))\n",
    "            return [self[i] for i in range(start, stop, step)]\n",
    "        elif isinstance(index, int):\n",
    "            return self.X[index], self.Y[index] \n",
    "\n",
    "    def __len__(self):\n",
    "        return len(self.Y)\n",
    "\n",
    "                    \n",
    "def load_merge_data(train_val_MC,train_val_SC,split_ratio=None, max_batch_size=2048, filter_func_MC=None, filter_func_SC=None):\n",
    "    full_dataset = Dataset_LI(train_val_MC, train_val_SC, max_batch_size,filter_func_MC=filter_func_MC, filter_func_SC=filter_func_SC)\n",
    "    if split_ratio == None:\n",
    "        split_ratio=0.2\n",
    "    if split_ratio > 1 : # not a ratio a number of batches\n",
    "        validation_size = split_ratio\n",
    "    else:\n",
    "        validation_size = int(split_ratio * len(full_dataset))\n",
    "    indices = list(range(len(full_dataset)))\n",
    "    random.Random(42).shuffle(indices)\n",
    "    val_batches_indices, train_batches_indices = indices[:validation_size],\\\n",
    "                                               indices[validation_size:]\n",
    "    val_batches_list=[]\n",
    "    train_batches_list=[]\n",
    "    for i in val_batches_indices:\n",
    "        val_batches_list.append(full_dataset[i])\n",
    "    for i in train_batches_indices:\n",
    "        train_batches_list.append(full_dataset[i])\n",
    "    print(\"Data loaded\")\n",
    "    print(\"Sizes: \"+str((len(val_batches_list),len(train_batches_list)))+\" batches\")\n",
    "    return full_dataset, val_batches_list, val_batches_indices, train_batches_list, train_batches_indices\n",
    "\n",
    "class Model_Recursive_LSTM_LI(nn.Module):\n",
    "    def __init__(self, input_size, comp_embed_layer_sizes=[600, 350, 200, 180], drops=[0.225, 0.225, 0.225, 0.225], output_size=1):\n",
    "        super().__init__()\n",
    "        embedding_size = comp_embed_layer_sizes[-1]\n",
    "        regression_layer_sizes = [embedding_size] + comp_embed_layer_sizes[-2:]\n",
    "        concat_layer_sizes = [embedding_size*2+24] + comp_embed_layer_sizes[-2:]\n",
    "        comp_embed_layer_sizes = [input_size] + comp_embed_layer_sizes\n",
    "        self.comp_embedding_layers = nn.ModuleList()\n",
    "        self.comp_embedding_dropouts= nn.ModuleList()\n",
    "        self.regression_layers = nn.ModuleList()\n",
    "        self.regression_dropouts= nn.ModuleList()\n",
    "        self.concat_layers = nn.ModuleList()\n",
    "        self.concat_dropouts= nn.ModuleList()\n",
    "        for i in range(len(comp_embed_layer_sizes)-1):\n",
    "            self.comp_embedding_layers.append(nn.Linear(comp_embed_layer_sizes[i], comp_embed_layer_sizes[i+1], bias=True))\n",
    "            nn.init.xavier_uniform_(self.comp_embedding_layers[i].weight)\n",
    "            self.comp_embedding_dropouts.append(nn.Dropout(drops[i]))\n",
    "        for i in range(len(regression_layer_sizes)-1):\n",
    "            self.regression_layers.append(nn.Linear(regression_layer_sizes[i], regression_layer_sizes[i+1], bias=True))\n",
    "            nn.init.xavier_uniform_(self.regression_layers[i].weight)\n",
    "            self.regression_dropouts.append(nn.Dropout(drops[i]))\n",
    "        for i in range(len(concat_layer_sizes)-1):\n",
    "            self.concat_layers.append(nn.Linear(concat_layer_sizes[i], concat_layer_sizes[i+1], bias=True))\n",
    "#             nn.init.xavier_uniform_(self.concat_layers[i].weight)\n",
    "            nn.init.zeros_(self.concat_layers[i].weight)\n",
    "            self.concat_dropouts.append(nn.Dropout(drops[i]))\n",
    "        self.predict = nn.Linear(regression_layer_sizes[-1], output_size, bias=True)\n",
    "        nn.init.xavier_uniform_(self.predict.weight)\n",
    "        self.ELU=nn.ELU()\n",
    "        self.no_comps_tensor = nn.Parameter(nn.init.xavier_uniform_(torch.zeros(1, embedding_size)))\n",
    "#         self.ELU = nn.Tanh()\n",
    "        self.no_nodes_tensor = nn.Parameter(nn.init.xavier_uniform_(torch.zeros(1, embedding_size)))\n",
    "        self.comps_lstm = nn.LSTM(comp_embed_layer_sizes[-1], embedding_size, batch_first=True)\n",
    "        self.nodes_lstm = nn.LSTM(comp_embed_layer_sizes[-1], embedding_size, batch_first=True)\n",
    "        \n",
    "    def get_hidden_state(self, node, comps_embeddings, loops_tensor):\n",
    "        nodes_list = []\n",
    "        for n in node['child_list']:\n",
    "            nodes_list.append(self.get_hidden_state(n, comps_embeddings,loops_tensor))\n",
    "        if (nodes_list != []):\n",
    "            nodes_tensor = torch.cat(nodes_list, 1) \n",
    "            lstm_out, (nodes_h_n, nodes_c_n) = self.nodes_lstm(nodes_tensor)\n",
    "            nodes_h_n = nodes_h_n.permute(1,0,2)\n",
    "        else:       \n",
    "            nodes_h_n = torch.unsqueeze(self.no_nodes_tensor, 0).expand(comps_embeddings.shape[0], -1, -1)\n",
    "        if (node['has_comps']):\n",
    "            selected_comps_tensor = torch.index_select(comps_embeddings, 1, node['computations_indices'])\n",
    "            lstm_out, (comps_h_n, comps_c_n) = self.comps_lstm(selected_comps_tensor) \n",
    "            comps_h_n = comps_h_n.permute(1,0,2)\n",
    "        else:\n",
    "            comps_h_n = torch.unsqueeze(self.no_comps_tensor, 0).expand(comps_embeddings.shape[0], -1, -1)\n",
    "        selected_loop_tensor = torch.index_select(loops_tensor,1,node['loop_index'])\n",
    "        x = torch.cat((nodes_h_n, comps_h_n, selected_loop_tensor),2)\n",
    "        for i in range(len(self.concat_layers)):\n",
    "            x = self.concat_layers[i](x)\n",
    "            x = self.concat_dropouts[i](self.ELU(x))\n",
    "        return x  \n",
    "\n",
    "    def forward(self, tree_tensors):\n",
    "        tree, comps_tensor, loops_tensor = tree_tensors\n",
    "        #computation embbedding layer\n",
    "        x = comps_tensor\n",
    "        for i in range(len(self.comp_embedding_layers)):\n",
    "            x = self.comp_embedding_layers[i](x)\n",
    "            x = self.comp_embedding_dropouts[i](self.ELU(x))  \n",
    "        comps_embeddings = x\n",
    "        #recursive loop embbeding layer\n",
    "        prog_embedding = self.get_hidden_state(tree, comps_embeddings, loops_tensor)\n",
    "        #regression layer\n",
    "        x = prog_embedding\n",
    "        for i in range(len(self.regression_layers)):\n",
    "            x = self.regression_layers[i](x)\n",
    "            x = self.regression_dropouts[i](self.ELU(x))\n",
    "        out = self.predict(x)\n",
    "#         print(out[:,0,:].shape)\n",
    "        return out[:,0,:]  #(out[:,0])#self.ELU(out[:,0,0])       nb_elem/batch  nb_comp 15\n",
    "    \n",
    "    \n",
    "def get_results_df_LI(dataset, batches_list, indices, model, log=False):   \n",
    "    df = pd.DataFrame()\n",
    "    model.eval()\n",
    "    torch.set_grad_enabled(False)\n",
    "    all_outputs=[]\n",
    "    all_labels=[]\n",
    "    prog_names=[]\n",
    "    #sched_names=[]\n",
    "    exec_times=[]\n",
    "    soft = nn.Softmax(-1)\n",
    "\n",
    "    for k, (inputs, labels) in tqdm(list(enumerate(batches_list))):\n",
    "        original_device = labels.device\n",
    "        inputs=(inputs[0], inputs[1].to(train_device), inputs[2].to(train_device))\n",
    "        labels=labels.to(train_device)\n",
    "        outputs = model(inputs)\n",
    "        assert outputs.shape == labels.shape\n",
    "        \n",
    "        \n",
    "        outputs_soft = soft(outputs[...,0:106]) # special case\n",
    "        for i in range(1,5):\n",
    "            outputs_soft = torch.cat((outputs_soft,soft(outputs[...,106*i:106*(i+1)])),-1)\n",
    "        assert outputs_soft.shape == labels.shape\n",
    "        #verified: outputs_softmax has the same shape\n",
    "        all_outputs.append(outputs_soft) ##fixed\n",
    "        all_labels.append(labels)\n",
    "\n",
    "        for j, prog_name in enumerate(dataset.batched_program_names[indices[k]]):   #####\n",
    "            #sched_names.append(sched_name)\n",
    "            prog_names.append(dataset.batched_program_names[indices[k]][j])\n",
    "            exec_times.append(dataset.batched_exec_time[indices[k]][j])\n",
    "        inputs=(inputs[0], inputs[1].to(original_device), inputs[2].to(original_device))\n",
    "        labels=labels.to(original_device)\n",
    "        \n",
    "    preds = torch.cat(all_outputs).cpu().detach().numpy() #because it is modified above to be a tensor\n",
    "    targets = torch.cat(all_labels).cpu().detach().numpy()\n",
    "    \n",
    "                                  \n",
    "    assert preds.shape == targets.shape \n",
    "    df['name'] = prog_names\n",
    "    df['exec_time'] = exec_times\n",
    "    df['prediction'] = list(format_output(preds)[:,:]) #MISTAKES \n",
    "    df['target'] = list(targets[:,:])\n",
    "    return df\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#####################################\n",
    "# functions for LI \n",
    "def pos(a,depth):  # calculate the position of the interchange in the output vector\n",
    "    if(a==0):\n",
    "        return 0\n",
    "    elif (a==1):\n",
    "        return depth-1\n",
    "    else:\n",
    "        return pos(a-1,depth)+depth-a\n",
    "\n",
    "def encode_interchage(str_sched,program_depth): #encode the output vector to get '1' in the right LI, '0' elsewhere\n",
    "    output = np.zeros(106,dtype=int) # 106 = 2 C 15 + 1\n",
    "    str_interchange = re.findall('I\\(.*\\)', str_sched)  # get the LI string\n",
    "    if str_interchange==[]:\n",
    "        output[0] = 1\n",
    "    else:\n",
    "        m = re.findall(r'\\d+', str_interchange[0])  # get the number of the loops\n",
    "        a = min(int(m[-2]),int(m[-1]))\n",
    "        b = max(int(m[-2]),int(m[-1]))\n",
    "        i2 = b-a\n",
    "        i1 = pos(a,15)\n",
    "        output[i1+i2]=1      \n",
    "    return output\n",
    "\n",
    "def index_interchage(str_sched,program_depth): #encode the output vector to get '1' in the right LI, '0' elsewhere\n",
    "    output = np.zeros(106,dtype=int) # 106 = 2 C 15 + 1\n",
    "    str_interchange = re.findall('I\\(.*\\)', str_sched)  # get the LI string\n",
    "    if str_interchange==[]:\n",
    "        return(0)\n",
    "    else:\n",
    "        m = re.findall(r'\\d+', str_interchange[0])  # get the number of the loops\n",
    "        a = min(int(m[-2]),int(m[-1]))\n",
    "        b = max(int(m[-2]),int(m[-1]))\n",
    "        i2 = b-a\n",
    "        i1 = pos(a,15)\n",
    "        return(i1+i2)      \n",
    "\n",
    "    \n",
    "    \n",
    "def get_sched_by_string(sched_str,schedules):\n",
    "    for schedID in range(len(schedules)):\n",
    "        sched = schedules[schedID]\n",
    "        schedExp_str = sched['sched_str']\n",
    "        if schedExp_str == sched_str: # found the right schedule\n",
    "            return sched, schedID\n",
    "        \n",
    "def get_results_times_function(vector,schedules):\n",
    "    \n",
    "    sched_str = \"I(L\"\n",
    "    np_vect= np.array(vector)\n",
    "    indices = np.where(np_vect==1)[0]\n",
    "    if len(indices) != 0: # check if a LI is applied\n",
    "        sched_str = sched_str + str(indices[0]) + \",L\" + str(indices[1]) + \")\"\n",
    "    else :\n",
    "        sched_str = \"\"\n",
    "        \n",
    "    sched = get_sched_by_string(sched_str,schedules)\n",
    "    if sched != None :\n",
    "        sched_exec_time = np.min(sched['execution_times']) \n",
    "        return sched_exec_time\n",
    "    else :\n",
    "        return -1\n",
    "    \n",
    "\n",
    "def format_output(arr):  ##\n",
    "#     indices = np.argsort(arr)[:,-1:] # shape of (#elems, 1)\n",
    "    pred = np.zeros(arr.shape)\n",
    "    for b in range(k):\n",
    "        indices = np.argmax(arr[...,106*b:106*(b+1)], -1)\n",
    "        for i in range(indices.shape[0]):\n",
    "            pred[i,106*b + indices[i]] = 1\n",
    "    return pred\n",
    "\n",
    "#####################################\n",
    "# functions for SC \n",
    "\n",
    "def speedup_clip(speedup):\n",
    "    if speedup<0.01:\n",
    "        speedup = 0.01\n",
    "    return speedup\n",
    "\n",
    "def sched_json_to_sched_str(sched_json): # Works only for 1 comp programs\n",
    "    orig_loop_nest = []\n",
    "    orig_loop_nest.append(sched_json['tree_structure']['loop_name'])\n",
    "    child_list = sched_json['tree_structure']['child_list']\n",
    "    while len(child_list)>0:\n",
    "        child_loop = child_list[0]\n",
    "        orig_loop_nest.append(child_loop['loop_name'])\n",
    "        child_list = child_loop['child_list']\n",
    "        \n",
    "    comp_name = [n for n in sched_json.keys() if not n in ['unfuse_iterators','tree_structure','execution_times']][0]\n",
    "    schedule = sched_json[comp_name]\n",
    "    transf_loop_nest = orig_loop_nest\n",
    "    sched_str = ''\n",
    "    \n",
    "    if schedule['interchange_dims']:\n",
    "        first_dim_index = transf_loop_nest.index(schedule['interchange_dims'][0])\n",
    "        second_dim_index = transf_loop_nest.index(schedule['interchange_dims'][1])\n",
    "        sched_str+='I(L'+str(first_dim_index)+',L'+str(second_dim_index)+')'\n",
    "        transf_loop_nest[first_dim_index], transf_loop_nest[second_dim_index] = transf_loop_nest[second_dim_index], transf_loop_nest[first_dim_index]\n",
    "    if schedule['skewing']:\n",
    "        first_dim_index = transf_loop_nest.index(schedule['skewing']['skewed_dims'][0])\n",
    "        second_dim_index = transf_loop_nest.index(schedule['skewing']['skewed_dims'][1])\n",
    "        first_factor = schedule['skewing']['skewing_factors'][0]\n",
    "        second_factor = schedule['skewing']['skewing_factors'][1]\n",
    "        sched_str+='S(L'+str(first_dim_index)+',L'+str(second_dim_index)+','+str(first_factor)+','+str(second_factor)+')'\n",
    "    if schedule['parallelized_dim']:\n",
    "        dim_index = transf_loop_nest.index(schedule['parallelized_dim'])\n",
    "        sched_str+='P(L'+str(dim_index)+')'\n",
    "    if schedule['tiling']:\n",
    "        if schedule['tiling']['tiling_depth']==2:\n",
    "            first_dim = schedule['tiling']['tiling_dims'][0]\n",
    "            second_dim = schedule['tiling']['tiling_dims'][1]\n",
    "            first_dim_index = transf_loop_nest.index(first_dim)\n",
    "            second_dim_index = transf_loop_nest.index(second_dim)\n",
    "            first_factor = schedule['tiling']['tiling_factors'][0]\n",
    "            second_factor = schedule['tiling']['tiling_factors'][1]\n",
    "            sched_str+='T2(L'+str(first_dim_index)+',L'+str(second_dim_index)+','+str(first_factor)+','+str(second_factor)+')'\n",
    "            i = transf_loop_nest.index(first_dim)\n",
    "            transf_loop_nest[i:i+1]=first_dim+'_outer', second_dim+'_outer'\n",
    "            i = transf_loop_nest.index(second_dim)\n",
    "            transf_loop_nest[i:i+1]=first_dim+'_inner', second_dim+'_inner'\n",
    "        else: #tiling depth == 3\n",
    "            first_dim = schedule['tiling']['tiling_dims'][0]\n",
    "            second_dim = schedule['tiling']['tiling_dims'][1]\n",
    "            third_dim = schedule['tiling']['tiling_dims'][2]\n",
    "            first_dim_index = transf_loop_nest.index(first_dim)\n",
    "            second_dim_index = transf_loop_nest.index(second_dim)\n",
    "            third_dim_index = transf_loop_nest.index(third_dim)\n",
    "            first_factor = schedule['tiling']['tiling_factors'][0]\n",
    "            second_factor = schedule['tiling']['tiling_factors'][1]\n",
    "            third_factor = schedule['tiling']['tiling_factors'][2]\n",
    "            sched_str+='T3(L'+str(first_dim_index)+',L'+str(second_dim_index)+',L'+str(third_dim_index)+','+str(first_factor)+','+str(second_factor)+','+str(third_factor)+')'\n",
    "            i = transf_loop_nest.index(first_dim)\n",
    "            transf_loop_nest[i:i+1]=first_dim+'_outer', second_dim+'_outer', third_dim+'_outer'\n",
    "            i = transf_loop_nest.index(second_dim)\n",
    "            transf_loop_nest[i:i+1]=first_dim+'_inner', second_dim+'_inner', third_dim+'_inner'\n",
    "            transf_loop_nest.remove(third_dim)\n",
    "    if schedule['unrolling_factor']:\n",
    "        dim_index = len(transf_loop_nest)-1\n",
    "        dim_name =transf_loop_nest[-1]\n",
    "        sched_str+='U(L'+str(dim_index)+','+schedule['unrolling_factor']+')'\n",
    "        transf_loop_nest[dim_index:dim_index+1] = dim_name+'_Uouter', dim_name+'_Uinner'\n",
    "    \n",
    "    return sched_str\n",
    "\n",
    "#####################################\n",
    "# functions for MC\n",
    "\n",
    "def shared_loop_nest(program_json):\n",
    "    stop = False\n",
    "    loop_nest = []\n",
    "    iterators = program_json['iterators']\n",
    "    j = 0\n",
    "    for i in list(iterators.keys()) : \n",
    "        if not stop : \n",
    "            iterator = iterators[i]\n",
    "            if iterator['child_iterators'] != [] :  #in the middle of the tree\n",
    "                if iterator['computations_list'] != [] :  #has some computations\n",
    "                    stop = True\n",
    "                else:\n",
    "                    if len( iterator['child_iterators'] ) >= 2 :\n",
    "                        stop = True\n",
    "            if stop == False :\n",
    "                loop_nest.append( \"i\"+str(j) )\n",
    "        else : \n",
    "            return loop_nest\n",
    "        j = j + 1\n",
    "    return loop_nest\n",
    "\n",
    "def legal_LI(schedule_str, sched_ind, loops):\n",
    "    \n",
    "    if(schedule_str==\"\"):\n",
    "        return True\n",
    "    else :\n",
    "        regex1 = \"I\\(\\{[C0-9,]+\\},L[0-9]+,L[0-9]+\\)$\" \n",
    "        LI = re.findall(regex1, schedule_str)  # get the LI string\n",
    "        \n",
    "        m = re.findall(r'\\d+', LI[0])  # get the loops\n",
    "        L1 = 'i' + m[-2]\n",
    "        L2 = 'i' + m[-1]\n",
    "        if (L1 in loops) and (L2 in loops):\n",
    "            return True\n",
    "        else:\n",
    "            return False\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "#restore the string of the LI from the index of the LI model output vector\n",
    "def get_LI_ordered(output, k = 5):\n",
    "    LIs = []\n",
    "    taken = []\n",
    "    for i in range(k):\n",
    "        ind = np.argmax(output[...,106*i:106*(i+1)]) # return the indice of the chosen LI\n",
    "        if ind in taken:\n",
    "            continue\n",
    "        taken.append(ind)\n",
    "        if ind == 0:\n",
    "            LIs.append(\"\")\n",
    "        else:\n",
    "            for i in range(15):\n",
    "                if (ind < (15 - i)):\n",
    "                    str2 = \"I(L\" + str(i) + \",L\" + str(ind+i)+ \")\"\n",
    "                    str2.strip()\n",
    "                    if str2 not in LIs:\n",
    "                        LIs.append(str2)\n",
    "                    break\n",
    "                else:\n",
    "                    ind= ind - 15 + i + 1\n",
    "    return LIs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc-autonumbering": false,
  "toc-showcode": false,
  "toc-showmarkdowntxt": false
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
